Product Unit Properties
This table defines the structure of the product unit entity, including all properties and their descriptions. Product units represent individual instances of products that can be tracked and managed independently.
π Core Propertiesβ
Property | Type | Required | Description |
---|---|---|---|
id | string | No (Auto) | Unique identifier for the unit |
productId | string | Yes | ID of the parent product |
active | boolean | No | Whether the unit is active (default: true) |
serialNumber | string | No | Unique serial number for physical units |
assignedTo | string | No | ID of user or group assigned to this unit |
π Interpretationβ
id
is auto-generated if not providedproductId
must reference an existing productactive
controls unit availabilityserialNumber
should be unique when providedassignedTo
references a user or group ID
π― Example Use Casesβ
{
"id": "unit_01G5H2V6J7K8L9M0N",
"productId": "prod_01F4G5H6J7K8L9M0",
"active": true,
"serialNumber": "SN2025051234",
"assignedTo": "user_01A2B3C4D5E6F7G8"
}
π Status Propertiesβ
Property | Type | Required | Description |
---|---|---|---|
status | string | No | Current status of the unit |
statusReason | string | No | Reason for current status |
lastActive | datetime | No | Last time unit was active |
π Interpretationβ
status
can be: "available", "assigned", "inactive"statusReason
provides context for status changeslastActive
is auto-updated on status changes
π― Example Use Casesβ
{
"status": "assigned",
"statusReason": "Allocated to development team",
"lastActive": "2025-05-22T15:30:00Z"
}
π·οΈ Metadata Propertiesβ
Property | Type | Required | Description |
---|---|---|---|
notes | string | No | Additional information about the unit |
tags | string[] | No | Custom tags for categorization |
extraFields | object | No | Custom additional fields |
π Interpretationβ
notes
can contain any relevant informationtags
help with unit categorizationextraFields
allows custom properties
π― Example Use Casesβ
{
"notes": "Development license - Team A",
"tags": ["development", "temporary"],
"extraFields": {
"location": "HQ Office",
"department": "Engineering"
}
}
β Tracking Propertiesβ
Property | Type | Required | Description |
---|---|---|---|
createdAt | datetime | No (Auto) | Unit creation timestamp |
updatedAt | datetime | No (Auto) | Last update timestamp |
assignedAt | datetime | No | When unit was assigned |
expiresAt | datetime | No | Unit expiration date |
π Interpretationβ
createdAt
andupdatedAt
are system-maintainedassignedAt
tracks assignment timingexpiresAt
used for time-limited units
π― Example Use Casesβ
{
"createdAt": "2025-05-22T10:00:00Z",
"updatedAt": "2025-05-22T15:30:00Z",
"assignedAt": "2025-05-22T15:30:00Z",
"expiresAt": "2026-05-22T23:59:59Z"
}
π Validation Rulesβ
-
Core Properties
id
must be uniqueproductId
must reference valid productserialNumber
must be unique if provided
-
Status Properties
status
must be valid enum valuelastActive
must be valid datetime
-
Metadata Properties
tags
array items must be stringsextraFields
must be valid JSON object
-
Tracking Properties
expiresAt
must be future date- All dates must be valid ISO 8601