D96 · A car leaves the pool only with a purpose its records allow, and clear or with each failing aspect approved by the team that owns it
Proposed · 2026-11-10 · zuki, for the higher-ups, in a CTO session reviewing v1's workflows; it binds when this page's pull request is merged · Answers #85 · Applies to the gate (GATE) and phases 3 to 6 of the business flow
Decision: the satpam records every car in and out of a pool. A car goes out only for a purpose its records allow, and only when it is clear or each aspect that fails is approved by the team that owns it. v1's gate data is test data, so nothing loads (R-GATE-14); the table is reshaped in place (D11).
-
One row per stay. A gate pass is a car's stay at the pool: an in purpose when it arrives, an out purpose when it leaves, and an out request between them. A row open at the out means the car is inside, and a car has at most one open row. A car already inside at cutover, or new to the fleet, starts its row at its first out request.
kindgoes: a stay that starts as a return and ends as a pickup has no single kind. -
The purposes:
Purpose In Out, and what it needs rentalA driver brings a rented car, such as for its checkpoint The car's active rental returnThe car is back without its BASTK: it becomes unchecked(D92)Never an out garageBack from the garage The car's open work order; the insurer's garage is its claim's (D91) transferArriving from another pool An approved transfer of the car from this pool (R-TRF) teamBack from the team's use The member who takes it, and a reason guestA vehicle that isn't the fleet's A plate only -
The exit check runs when the out is requested, and its result is kept on the pass (R-GATE-07):
Out purpose Aspects Approved by rentalDebt: a charge type over its threshold (R-GATE-06) Finance: gate_debt:approve Service: the odometer at its next service (R-GATE-12) The vehicle team's leader, admin_fleet: gate_service:approve Checkpoint: overdue (R-INSP-10) The checker team's leader, admin_fleet: gate_checkpoint:approve teamTeam use, every time admin_fleet: gate_team:approve garage,transfer,guestNone — Each team's leader holds its own, and admin and super_admin hold all four; a leader shares one with a member of their team by delegating it (D97). gate:approve goes. Each failing aspect needs its own approval on the pass (R-GATE-02, R-GATE-13); the satpam records the out only when none is left.
-
#85's two questions: an overdue checkpoint fails the checkpoint aspect; a car still within its week passes, and a late one is still let in (R-GATE-11). A car with no service record counts from its first odometer reading.
-
The scan reads the car's QR code, its unit code, as at a stock opname (D93). When the code can't be read, the satpam types the plate, and the pass says which scan was typed.
-
The gate changes no status but one: a return in sets
unchecked(D92). A garage out and in give the car's place (D91). A handover, a BASTK or a transfer never waits for a gate pass, so a gate that is down stops no rental. -
The approver is told. An out waiting for an aspect is an M5 notification (D95), seen by that aspect's permission at the pool.
Why: zuki, 2026-11-10, for the higher-ups: a driver leaving with a car must be clear, or each failing aspect is approved by the team that owns it: debt by finance, the odometer by the vehicle team; a car may also leave for the team's own use or for its garage. A single gate:approve let any approver clear any aspect, so each aspect gets its own permission. One row per stay keeps a car's in and out together while its purposes differ, and an out request gives an approval its row before the car leaves. zuki took the CTO's defaults for the rest.
Consequences:
- DOC (data phase, #593): the GATE page's rules for the stay, the purposes, the exit check by purpose, the four permissions (R-GATE-05, R-ACC-86's count) and the scan; #85 closes.
- BE (data phase, #594):
gate_passesreshaped,gate_aspectgainsteam_use, the four permissions in the seed, the pgTAP tests, db-types. No step changes, and TL-DP-04 needs none. - M5: the exit check, recording an in and an out, the approvals and their notification, as functions; the gate page.
- The data phase's part rides slice #584 (timeline row 0n).