Validation shared by create and update requests.
Make invalid input understandable before it is saved.
Where this work fits
Inventory work needed more than a product name. Price, quantity, category, availability, and publication status described different things, and users needed to create, find, and update those records.
I added validation for product inputs, including numeric and category fields. Update requests reused those rules while allowing partial changes. Invalid field types could be rejected before persistence, with feedback the caller could act on.
Check an input before changing a record
Waiting for a request
The DTO defines the expected fields and types.
Request → validation → serviceAn unpublished product is not an out-of-stock product.
I kept publication and availability as separate fields rather than compressing them into one status. Create and update requests shared validation rules, while partial updates let a user change a field without resubmitting the entire record.
The skills behind the work
- NestJS
- Organize backend endpoints, validation, and services around product responsibilities.
- Validation
- Reject invalid or unsupported input before it affects the rest of the application.
- TypeScript
- Make data shapes and code boundaries explicit while building product behavior.
The inventory services supported structured product entry, filtered retrieval, and updates. Businesses could manage those details through defined API operations.