Product Variants Attributes Service
Overview
Product Variants Attributes define the attribute combination that characterises a specific product variant (e.g. a set of dimension assignments such as Colour + Size).
Each attribute record links:
- a variant (
Product Variant Id) — the variant being described - a system type (
Product System Type Id) — the attribute type (e.g. a dimension such as Colour) - a variants type value (
Product Variants Type Id) — the selected value (e.g. Midnight Blue)
A variant with two attributes (e.g. one for Colour and one for Size)
is described by exactly two ProductVariantsAttributes records.
This model is intentionally minimal and 1:1 with the database table. The full composed representation (variant + attributes + images) is available via the Products service.
All operations are tenant-aware and scoped to the current tenant.
Endpoints
GET
/api/v1/ProductVariantsAttributes/variant/{variantId}
Returns all attribute assignments for a given variant.
Behavior:
- Returns all records linked to the specified
variantId - Returns
404if no attributes exist for the variant
Authorization:
- No authentication required
GET
/api/v1/ProductVariantsAttributes/{id}
Returns a single attribute assignment by its identifier.
Behavior:
- Looks up attribute by
Id - Returns
404if the record does not exist
Authorization:
- No authentication required
POST
/api/v1/ProductVariantsAttributes
Assigns a dimension value to a product variant.
Request body:
Product Variant Id(long, required) - the variant to assign toProduct System Type Id(int, required) - the dimension being assigned (e.g. Colour system type)Product Variants Type Id(long, required) - the specific value fromProductVariantsType(e.g. Midnight Blue)
Behavior:
- Validation is handled in the service layer
- All three foreign key fields must reference existing records
- Successful creation writes an audit log entry
Errors:
- Returns
400if validation fails
Authorization:
- Requires Bearer Token
PUT
/api/v1/ProductVariantsAttributes/{id}
Updates an existing attribute assignment.
Request:
- Attribute ID is taken from the route
- Body must include:
Id(long, required)Product Variant Id(long, required)Product System Type Id(int, required)Product Variants Type Id(long, required)
Behavior:
- All fields overwrite existing values
- Successful update writes an audit log entry
Errors:
- Returns
400if validation fails or record does not exist
Authorization:
- Requires Bearer Token
DELETE
/api/v1/ProductVariantsAttributes/{id}
Removes an attribute assignment 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 record does not exist or deletion fails
Authorization:
- Requires Bearer Token
Notes
- Validation is enforced in the service layer, not via model attributes
- Each record is a single dimension assignment; a variant typically has one record per system type
- The full variant + attribute composition is exposed by the Products service
- All state-changing operations are audited
- Internal errors are logged but not exposed to clients