docs: README — data is wired to live MariaDB (was "currently SAMPLE")

The overview API reads live MariaDB since 2026-07-02; sample:true is only the
standalone dev fallback. Replaced the "wire it (TODO)" section with the live
column sources + resolved the notVerladen open question.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-07-06 11:14:22 +02:00
parent f36d3966ea
commit cc8a76cdef

View File

@ -99,23 +99,18 @@ figures — presses / on-the-way / oven are always real-time.
}
```
### Wiring the REAL data (currently SAMPLE)
### Live data wiring
`api/routes.py` returns sample data today. To make it live (see the big `TODO` there
and `.claude/memory/temper-line-overview.md` in the gateway):
- Import the kernel proxy: `from .._db import run_select_query` (read-only).
- Reuse the temper status-derivation in `modules/fastpress/press/temper.py`
(`_temper_aggregates_all` derives on-way / in-oven / finished from planned
timestamps vs `NOW()`), un-scoped across **all** presses. Read
`production.temper_tracking` (carts grouped by `ttCartId`, keyed by origin press
`ttPress`) + `production.active_orders`/`finished_orders`.
- `notVerladen` = produced good parts (cycles) parts logged to temper. **Open
question:** per-press or plant-wide?
- Scope `finished` by `range` on `ttOutOfOvenAt`. Never echo customer/price fields.
Alternatively, add a public `GET /press/temper/overview` in fastpress and have the
frontend call that — decide before wiring; keep the payload shape above either way.
`api/routes.py` reads live MariaDB (`sample:true` only appears in the standalone
dev fallback with no backend). Details + the exact column sources are in the gateway
memory `.claude/memory/temper-line-overview.md`. In short: it uses the kernel proxy
`from .._db import run_select_query` (read-only), un-scoped across **all** presses for
plant `PLANT_NAME` — press list from `press_settings.presses`; good/chips from
`active_orders`+`rejects`; run/stop/idle from `cycles_new` recency; carts +
`notVerladen` from `production.temper_tracking` with position derived in SQL from the
planned timestamps vs `NOW()` (reprints excluded). `finished` is scoped by `range` on
`ttOutOfOvenAt`. Oven temperature is omitted (no sensor). Never echo customer/price
fields.
---