docs: README — data is wired to live MariaDB + reject writes (was "currently SAMPLE")
Overview reads live MariaDB and POST /reject writes since 2026-07-02. Replaced the
"wire it (TODO)" section with the live wiring; noted the HTTP-200+{success:false}
contract and the rejTtId column added by fastpress migration 009; collapsed the
resolved open questions (per-ttId booking + belt semantics), leaving only the
login-free-write security question open.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ac63988e6d
commit
7529bc1949
43
README.md
43
README.md
@ -90,32 +90,33 @@ Belt colour mapping (matches PressV process colours): `notYetSent`→violet,
|
|||||||
`wagen`→cyan, `unterwegs`→amber, `ofen`→orange, `fertig`→emerald; the reject accent
|
`wagen`→cyan, `unterwegs`→amber, `ofen`→orange, `fertig`→emerald; the reject accent
|
||||||
is Grafana dark-red `#C4162A`.
|
is Grafana dark-red `#C4162A`.
|
||||||
|
|
||||||
### Wiring the REAL data (currently SAMPLE)
|
### Live data wiring
|
||||||
|
|
||||||
`api/routes.py` returns sample data and `POST /reject` echoes success **without
|
`api/routes.py` reads live MariaDB and `POST /reject` writes (details in the gateway
|
||||||
writing**. To make it live (see the `TODO` there + `.claude/memory/ausschuss-station.md`):
|
memory `.claude/memory/ausschuss-station.md`; `sample:true` only in the standalone dev
|
||||||
|
fallback). Via `from .._db import run_select_query, transaction`:
|
||||||
|
|
||||||
- `from .._db import run_select_query, transaction`.
|
- **overview:** reads `production.temper_tracking` across **all** presses (un-scoped),
|
||||||
- **overview:** read `production.temper_tracking` across **all** presses (un-scoped),
|
one row per `ttId`, newest-first by `ttOutOfOvenAt` (`ttStatus='done'`), joined to
|
||||||
one row per `ttId`, newest first by `ttOutOfOvenAt` (`ttStatus='done'`); join
|
`active_orders`/`finished_orders`, windowed on `ttOutOfOvenAt`. The order-level
|
||||||
`active_orders`/`finished_orders` for the article. Add each order's 5-station
|
5-station distribution reuses `modules/fastpress/press/temper.py::_temper_aggregates_all`.
|
||||||
distribution — reuse `modules/fastpress/press/temper.py::_temper_aggregates_all`
|
|
||||||
(notYetSent / sentToTemper / onWayToOven / inOven / finishedTempering). Filter by
|
|
||||||
`window` on `ttOutOfOvenAt`.
|
|
||||||
- **reasons:** `SELECT id, reason_de, reason_en FROM settings.reject_reasons WHERE active=1`.
|
- **reasons:** `SELECT id, reason_de, reason_en FROM settings.reject_reasons WHERE active=1`.
|
||||||
- **reject:** one `INSERT` into `production.rejects` inside a `transaction()` — same
|
- **reject:** one `INSERT` into `production.rejects` inside a `transaction()` (an
|
||||||
shape as `modules/fastpress/press/rejects.py::send_reject`. Booking references the
|
un-scoped reuse of PressV `send_reject`), keyed by `rejOrdernumber`+`rejPress` from
|
||||||
cart, which needs an **additive nullable `rejTtId` column** (a DBA applies it; the
|
the body — the device-scoped `POST /press/rejects/send` can't be reused (it derives
|
||||||
runtime account has no `ALTER`). The device-scoped `POST /press/rejects/send`
|
the press from the device JWT). ⚠ `/reject` returns **HTTP 200 + `{success:false}`**
|
||||||
can't be reused — it derives the press from the device JWT; here `press`+`ttId`
|
on failure (not 4xx/5xx — else the frontend store swallows it into a fake success).
|
||||||
come from the body.
|
|
||||||
|
|
||||||
### Open questions before go-live (from the design memory)
|
Note: a nullable `rejTtId` column was later added (fastpress migration 009) so rejects
|
||||||
|
attribute to the correct press cycle — see the gateway memory
|
||||||
|
`temper-cycle-reject-attribution.md`.
|
||||||
|
|
||||||
1. **Security of the login-free write:** network/reverse-proxy restriction only, or a
|
### Open question before go-live
|
||||||
static `STATION_TOKEN` in `.env`? (No TLS/reverse-proxy exists yet.)
|
|
||||||
2. Confirm the `rejTtId` column name + that per-`ttId` booking is desired (yes, per spec).
|
**Security of the login-free write:** network/reverse-proxy restriction only, or a
|
||||||
3. Belt semantics: order-level distribution (chosen) vs. the cart's own journey position.
|
static `STATION_TOKEN` in `.env`? (No TLS/reverse-proxy exists yet.) Because this
|
||||||
|
terminal **writes**, resolve this before exposing it beyond a trusted LAN. (Resolved:
|
||||||
|
per-`ttId` booking is desired; belt shows the order-level distribution.)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user