6.5.2.8 ProductMaterial
6.5.2.8.1 Purpose¶
A physical lot of farm product, such as bulk-tank milk. It is the subject of product observations and samples when a value describes mixed product rather than one animal.
6.5.2.8.2 Questions it answers¶
- Which milk lot does this result describe?
- Which Organization does the lot belong to?
- Which time does the lot represent?
6.5.2.8.3 Fields¶
| Field | Type | Cardinality | Description |
|---|---|---|---|
id |
string (uuid) |
1..1 |
Key. |
organization |
Organization | 0..1 |
|
source_producer |
SourceProducerEntity | 1..1 |
The producer of the material record itself; each result keeps its own producer on the observation. |
source_material_reference |
string |
0..1 |
|
represented_time |
ObservationTime | 1..1 |
|
revision |
RecordRevision | 1..1 |
|
status |
enum | 1..1 |
Values: active, cancelled. Default: active. |
created_at |
datetime |
1..1 |
|
updated_at |
datetime |
1..1 |
6.5.2.8.4 Subtypes¶
Discriminator product: a ProductMaterial is at most one of the subtypes below (disjoint, not complete), so records with none of them are allowed.
MilkMaterial¶
| Field | Type | Cardinality | Description |
|---|---|---|---|
kind |
enum | 1..1 |
Values: bulk_tank, shipment, pooled_sample, other_documented, unknown. |
- Unknown kind still means confirmed mixed milk, not an unidentified cow.
EggLot¶
Future work
Part of the model, but built only when a real case needs it. No egg data yet.
| Field | Type | Cardinality | Description |
|---|---|---|---|
batch |
Batch | 0..1 |
The flock that laid it, when known. |
Future work
Grading, counts and product-specific observation types.
6.5.2.8.5 Relationships¶
References
ProductMaterial.organization→ Organization (0..1)ProductMaterial.source_producer→ SourceProducerEntity (1..1)EggLot.batch→ Batch (0..1)
Referenced by
ProductObservation.product_material(1..1)ObservationSession.product_material(0..1)ProductEvent.product_material(1..1)Sample.product_material(0..1)
Uses types
ObservationTime, RecordRevision
Subtypes
- by
product: MilkMaterial, EggLot
6.5.2.8.6 Rules & constraints¶
- A physical lot of farm product (mixed milk, eggs, ...), not a full storage/logistics model. The milk rules below and in the canonical type catalog apply to the MilkMaterial subtype.
- References are source-scoped; a tank identifier alone does not identify every future milk batch in that tank.
- Source/evidence ties establish which material a sample represents; overlapping timestamps alone do not merge batches.
- Product access uses its resolved historical organization context; it grants no access to individual contributors' histories.
- Cancellation/reinstatement appends a revision; referenced historical samples/results remain auditable.