Initial production analytics foundation

This commit is contained in:
2026-09-04 05:34:52 +02:00
commit f017d187eb
30 changed files with 1219 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# Data model
The entities below describe intended persistence and domain boundaries; this
bootstrap does not define a database schema or migrations.
| Entity | Intended contents | Purpose |
| --- | --- | --- |
| `ProductionOrder` | source ID, machine ID, article/material reference, known interval | Central result-attribution context |
| `MachineState` | machine ID, state, observed interval | Runtime/downtime and contextual calculations |
| `CalculatedMetric` | name, value/unit, result interval, attribution, provenance | Integrated consumption and future aggregates |
| `ProcessEvent` | event type, time, payload/value, attribution, provenance | Completed peaks and threshold/cycle events |
| `CalculationRun` | type/version, execution time, source interval, status/metadata | Auditing and reproducibility |
| calculation state | calculation-instance/context key and serializable state | Incremental execution only |
## Provenance minimum
Each metric/event must store `calculation_type`, `calculation_version`, and
the ENLYZE source time range. Values should retain their unit. Production order
and article can be absent when ENLYZE cannot provide them for a particular
record; absence is explicit rather than fabricated.
## Database direction
TimescaleDB will store result/event time series and supporting relational
context. Schema design comes after the ENLYZE exploration milestone confirms
source identifiers, timestamp precision/timezone, ordering, correction, and
context-history behavior.