Product Property Value Service
Overview
The Product Property Value module manages dynamic attribute values assigned to products.
It stores (ProductId + PropertyId → Value) entries, which allows extending the product catalog without changing the product schema (e.g. material, width, compatibility notes, etc.).
This module:
- does not define properties (that is handled by the Property module)
- only stores the value for a given product + property pair
- enforces uniqueness of
(ProductId, PropertyId)during creation
All operations are tenant-aware and fully audited.
Endpoints
GET
/api/v1/ProductPropertyValue/GetAllProductPropertyValue
Returns all property values for a given product.
Query parameters:
productId(long, required)
Behavior:
- Returns a list of
(ProductId, PropertyId, Value)records for the product - Returns
404if the product has no property values
Response:
List<ProductPropertyValueModel>
Authorization:
- Requires Bearer Token
POST
/api/v1/ProductPropertyValue/AddNewProductPropertyValue
Creates a new product property value.
Request body:
ProductId(long, required)PropertyId(long, required)Value(string?, optional in model, but typically expected)
Behavior:
- Requires
ProductIdandPropertyId(service treats missing IDs as invalid) - Prevents duplicates for the same
(ProductId, PropertyId)pair - Writes an audit log entry on success
Errors:
- Returns
400if:ProductIdorPropertyIdis missing/0(ProductId, PropertyId)already exists- DB insert -
Authorization:
- Requires Bearer Token
PUT
/api/v1/ProductPropertyValue/UpdateProductPropertyValueByProductId/{productId}
Updates the value for a product property.
Route:
productId(long)
Request body:
PropertyId(long, required)Value(string?, optional)
Behavior:
- Uses
(ProductId from route, PropertyId from body)to find the record - Updates only the
Valuefield - If
Valueis null/empty/whitespace, it keeps the current value (no overwrite) - Writes an audit log entry on success
Errors:
- Returns
400if:ProductIdis missing/0PropertyIdis missing/0- record does not exist
- update -
Authorization:
- Requires Bearer Token
DELETE
/api/v1/ProductPropertyValue/DeleteProductPropertyValueByProductId/{productId}
Deletes all property values for a given product.
Behavior:
- Removes all
ProductPropertyValuerecords for the givenProductId - Writes an audit log entry including the number of deleted records
Errors:
- Returns
400if:- product has no property values
- deletion -
Authorization:
- Requires Bearer Token
Notes
- This module stores values only; property definitions are managed elsewhere
- Uniqueness of
(ProductId, PropertyId)is enforced in the service layer - Update overwrites only
Valueand only when non-empty - Deleting by ProductId deletes all property values for that product
- All state-changing operations are audited
- Internal errors are logged and not exposed to API consumers