D93 · A stock opname scans the floor against a snapshot of the pool's cars, and each missing car is an alert until the checker team rechecks it
Proposed · 2026-11-09 · zuki, in a CTO session reviewing v1's workflows; it binds when this page's pull request is merged · Answers #416 and #321 · Partly supersedes D75 (Stock Opname is no longer rebuilt as v1 has it)
Decision: a stock opname has one mode: the checker scans what is on the floor, and the system compares the scans with the list it took when the count started. The tables are reshaped in place (D11). The functions and the page stay M5's.
-
One open count per pool. It counts the cars at that pool and no other.
-
The list is a snapshot at the start. It holds every car whose place is the pool at that moment (D91, #583). That is every status except
rented, and except amaintenancecar at the insurer's garage, between itsgarage_outandgarage_in.inactivecars are on it: they stay in the pool. The list replaces the DM team's spreadsheet. -
A scan reads the car's QR code, the unit code, as at the gate. When the code can't be read, the checker types the plate, and the scan is saved as manual, so the counts say how many were typed. Every scan is saved, including one whose code or plate finds no car.
-
What a count shows, all computed from the list and the scans, never stored (D32):
Outcome Meaning Matched On the list and scanned Missing On the list, not scanned when the count finishes Extra, known car A v2 car scanned but not on the list: another pool's car, or one dropped at the gate after the count started ( unchecked, D92)Extra, unknown A code or plate that finds no car The screens call the third and fourth outcomes extra, never "unchecked", which is a car status.
-
A count runs outside service hours, when no car leaves the pool. A car that does leave isn't treated apart: if it isn't found, it is missing. The page shows a missing car's last gate pass, read from
gate_passes. -
A session is
open,finishedorvoid. Open while counting. Finished when the checker closes it: its counts are final. Void when it is abandoned, with a reason: its counts are ignored and it raises no alert. A deadline is shown, and an open count past it reads as overdue; nothing blocks it. -
A missing car is an alert on the stock opname page for the pool's checker team, with no notification. The team rechecks it: a recheck scan marks it found, or a checker confirms it missing, with a note. A recheck scan is saved as one and doesn't change the count's own numbers. A finished count takes recheck scans only. A count is settled when no alert is left, which is computed. A confirmed missing car is recorded and nothing more follows; anything further is a later decision.
-
The tables:
modeis dropped. v1'slist_to_flooris still read, so a new v1 mode stops the night (R-MIG-02).stock_opname_scanscomes back: per scan, the code or plate, whether it was typed, the car when one is found, the expected row it matched, whether it is a recheck, who and when.stock_opname_expectedlosesscanned,scanned_atandscanned_byto the scans, and gains the recheck outcome and its note.- v1's one void session and its 111 expected cars still load as history (R-OPN-14), with no scan. v1's
stock_opname_scanshas no row.
Why: zuki, 2026-11-09. Scanning the floor against the list gives every outcome, matched, missing and extra, so a list-to-floor mode adds nothing. Extra needs each scan kept, so the scans table comes back. The cars are scanned by their QR, as at the gate. A missing car is an alert on the page that sends the checker team to recheck it. A count runs outside service hours, so a car not found is simply missing. The DM team keeps its own list in a spreadsheet, which v2 replaces. Inactive cars are in the pool. zuki asked for the CTO's proposal on the statuses and took the defaults: a typed plate when a QR can't be read, and nothing after a confirmed missing car.
Consequences:
- DOC (data phase, #585): R-OPN-01 loses the mode; R-OPN-06 and R-OPN-07 are rewritten for scans and rechecks; R-OPN-08 gains the extra counts; new rules for the scans table and the recheck outcome; R-OPN-14 keeps its load with no scan. The "Not yet a rule" list on the Stock Opname page closes, except who started a v1 session, which stays signed as ignored (R-MIG-10).
- BE (data phase, #586): the tables in place, the operations step's mapping, the pgTAP tests, db-types.
- DOC, BE and FE (M5): the snapshot, scanning, finishing, voiding and rechecking as functions; the page with its alerts and its counts; the list's place read from #583.
- The data phase's part rides slice #584 with D91 and D92 (timeline row 0k).