Stock and Responsibility
This document covers stock-level entities:
Stockas the operational stock location/container,StockTypeas a governance register,SharedResponsibilityfor time-bound ownership sharing.
1. Business Meaning
1.1 What a Stock Represents
Stock is the operational stock container where materials/equipment are managed.
It has user-facing identity (key), technical identity (id), type, owner, status, and dynamic characteristics.
1.2 What Shared Responsibility Represents
SharedResponsibility models additional owners/responsible users for a stock with validity interval (validFrom, validTo).
This enables controlled sharing of operational responsibility without changing the primary stock owner.
1.3 Type Governance
StockType is a validity-governed register entry controlling stock classification and optional UI/behavior parameters.
1.4 Stock Type Input Compatibility
Stock.stockType accepts either:
- direct code string, or
- object payload containing
code.
This behavior is implemented by custom deserialization and improves input compatibility for different clients.
2. Entity Reference: Stock (Stock)
| Field | Type | Required | Read-only | Description |
|---|---|---|---|---|
id | UUID | No | No | Stock primary key. |
key | String | No (create) | No | Business-readable stock key; generated if not provided according to installation rules. |
name | String | Yes | No | Stock display name. |
chars | TsmChars | No | No | Dynamic stock attributes. |
status | StockStatus | No | No | Stock status enum (ACTIVE, INACTIVE). |
stockType | String | No | No | FK code to StockType.code. Input supports string or object-with-code format. |
ownerUserId | UUID | No | No | Primary owner user reference. |
def | Boolean | No | No | Default stock marker. |
description | String | No | No | Optional description. |
dataTags | List<String> | No | No | Optional labels/tags. |
processingData | Object | No | Write-only | Transient processing context (max 32 top-level keys, max 64 KB, max depth 12). |
3. Enum Reference: StockStatus (StockStatus)
| Value | Meaning |
|---|---|
ACTIVE | Stock can be used in operations. |
INACTIVE | Stock is inactive and typically excluded from active operations. |
4. Entity Reference: StockType (StockType)
| Field | Type | Required | Read-only | Description |
|---|---|---|---|---|
id | UUID | No | No | Stock type primary key. |
code | String | Yes | No | Technical unique code. |
name | String | Yes | No | Display name. |
validityFrom | Date | No | No | Validity start. |
validityTo | Date | No | No | Validity end. |
description | String | No | No | Optional description. |
localizationData | LocalizationData | No | No | Localization payload. |
registry | Map<String, Any?> | No | No | Register-level payload. |
processingData | Object | No | Write-only | Transient processing context (max 32 top-level keys, max 64 KB, max depth 12). |
entitySpecId | UUID | No | No | Optional entity specification reference. |
mnemonicCode | String | No | No | Optional mnemonic for key generation/business coding. |
createPrivilege | String | No | No | Optional privilege constraint for create operations. |
icon | String | No | Yes | Optional icon metadata (read-only). |
tsmModuleId | UUID | No | Yes | Optional module reference (read-only). |
config | Map<String, Any?> | No | No | Additional configuration payload. |
dataTags | List<String> | No | No | Optional labels/tags. |
5. Entity Reference: SharedResponsibility (SharedResponsibility)
| Field | Type | Required | Read-only | Description |
|---|---|---|---|---|
id | UUID | No | No | Responsibility record primary key. |
stock | String | No | No | FK to Stock.key. |
ownerUserId | UUID | No | No | Responsible user reference. |
validFrom | Date | No | No | Responsibility validity start. |
validTo | Date | No | No | Responsibility validity end. |
description | String | No | No | Optional description. |
data | Map<String, Any?> | No | No | Custom payload. |
dataTags | List<String> | No | No | Optional labels/tags. |