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β
idis auto-generated if not providedproductIdmust reference an existing productactivecontrols unit availabilityserialNumbershould be unique when providedassignedToreferences 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β
statuscan be: "available", "assigned", "inactive"statusReasonprovides context for status changeslastActiveis 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β
notescan contain any relevant informationtagshelp with unit categorizationextraFieldsallows 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β
createdAtandupdatedAtare system-maintainedassignedAttracks assignment timingexpiresAtused 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
idmust be uniqueproductIdmust reference valid productserialNumbermust be unique if provided
-
Status Properties
statusmust be valid enum valuelastActivemust be valid datetime
-
Metadata Properties
tagsarray items must be stringsextraFieldsmust be valid JSON object
-
Tracking Properties
expiresAtmust be future date- All dates must be valid ISO 8601