Product Size Service
Overview
The Product Size service manages size variants that can be assigned to products.
It is used to:
- define available size options (e.g. S, M, L, XL, numeric sizes)
- enable size-based filtering and selection
- standardize size definitions across the catalog
This service manages size definitions only. It does not assign sizes to products directly.
All operations are tenant-aware and all state-changing actions are audited.
Endpoints
GET
/api/v1/ProductSize/GetAllProductSize
Returns all product sizes filtered by active status.
Query parameters:
isActive(bool, required)
Behavior:
- Returns only sizes matching the provided
isActivevalue - Returns
404if no sizes match the filter
Authorization:
- Requires Bearer Token
GET
/api/v1/ProductSize/GetProductSizeById/{id}
Returns a single product size by its identifier.
Behavior:
- Looks up size by ID
- Returns
404if the size does not exist
Authorization:
- Requires Bearer Token
GET
/api/v1/ProductSize/GetProductSizeByCode/{code}
Returns a single product size by its unique code.
Behavior:
- Looks up size by
Code - Size codes are unique per tenant
- Returns
404if no size matches the provided code
Authorization:
- Requires Bearer Token
POST
/api/v1/ProductSize/AddNewProductSize
Creates a new product size.
Request body:
Code(string, required)Description(string, required)IsActive(bool, optional)CreatedAt(DateTime, optional)
Behavior:
- Validates required fields
- Prevents duplicate size codes per tenant
- If
IsActiveis not provided, it is stored asfalse - If
CreatedAtis not provided, current UTC time is used - Successful creation writes an audit log entry
Errors:
- Returns
400if:- required fields are missing
- size code already exists
Authorization:
- Requires Bearer Token
PUT
/api/v1/ProductSize/UpdateProductSizeById/{id}
Updates an existing product size.
Request:
- Size ID is taken from the route
- Body must include
CodeandDescription IsActiveis optional
Behavior:
- All required fields must be present
- Only provided fields are updated
CreatedAtis not modified- Successful update writes an audit log entry
Errors:
- Returns
400if:- validation -
- size does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/ProductSize/DeleteProductSizeById/{id}
Deletes a product size by its identifier.
Behavior:
- Performs a hard delete
- Record is permanently removed from the database
- Successful deletion writes an audit log entry
Errors:
- Returns
400if size does not exist
Authorization:
- Requires Bearer Token
Notes
- This service manages size definitions only
- No product assignments are handled here
- Deletions are permanent (hard delete)
- Validation is enforced in the service layer
- All state-changing operations are audited
- Internal errors are logged and not exposed to API consumers