feat(exit): forgiven exit — open the exit barrier with no payment (barrier:create)
Build & push images / images (push) Successful in 3m23s
Build & push images / images (push) Successful in 3m23s
The owner (or any role the owner grants barrier:create) lets a car out for free.
Exit side only. Every use is signed, attributed, photographed and on the operator's
Z-report; the shift's cash/card/drawer are untouched by construction.
- shared: resource 'barrier' + permission 'barrier:create'; reason codes
exit.forgiven / exit.forgiven.noSession; LedgerPayload.forgoneMinor.
- pay-station: forgive() signs a $0 payment carrying the quoted fee as forgoneMinor
(no tender), refuses a ticket with module charge lines (a wash is not forgiven).
- exit-flow: reopenBarrier(..., { forgiven }) bypasses the walk-back check and stamps
the forgiven reason on the anomaly + vehicle_exit; forgiveExitNoSession() for a car
with no ticket (anomaly under forgiven:<id> + exit snapshot + pulse). Relay driving
shared in #pulseExit.
- route POST /api/barrier/forgive { identity?, note? }: barrier:create + open shift;
the reason is optional (an empty note is signed as '(no reason given)').
- shift-service: forgoneTotalMinor + forgoneCount on the report/summary/signed
shift_z_report (only when > 0), print line 'Dalje të falura (N)'.
- web: 'Forgive & open' in the pay/exit modal for an open transient that owes money;
'Forgive & open exit' on the booth header for the no-ticket case; forgone line on
the X-report, close confirm and history; en/sq. Prints nothing.
- tests: exit-flow, pay-station, shift-service, HTTP route (403 without the
permission, 409 no shift, empty note accepted, ledger sequence, report figures).
- wiki: decisions/forgiven-exit.md (decision + as-built), booth-exit-flow, shift,
index, log.
This commit is contained in:
@@ -1102,6 +1102,10 @@ export interface ShiftSourceSplit {
|
||||
/** Module money that rode this till's tickets (a booth-paid wash), by module id.
|
||||
* Inside cash+card, OUTSIDE the ticket bucket. Absent on pre-2026-09 reports. */
|
||||
chargesByModuleMinor?: Partial<Record<string, number>>;
|
||||
/** Forgiven exits (wiki/decisions/forgiven-exit.md): fees an operator waived, and how
|
||||
* many. $0 payments — NOT inside cash/card. Absent on pre-2026-10 reports. */
|
||||
forgoneTotalMinor?: number;
|
||||
forgoneCount?: number;
|
||||
}
|
||||
|
||||
export interface ShiftReport extends ShiftSourceSplit {
|
||||
@@ -1448,6 +1452,16 @@ export function reopenBarrier(identity: string): Promise<{ ok: true; opened: boo
|
||||
return apiFetch("/api/barrier/reopen", { method: "POST", body: JSON.stringify({ identity }) });
|
||||
}
|
||||
|
||||
/** FORGIVEN exit (barrier:create): open the exit with NO payment. With a ticket the fee
|
||||
* owed is signed as forgone on a $0 payment; with `identity` null the car has no
|
||||
* session (anomaly + snapshot + pulse). `note` is the mandatory reason. Prints nothing. */
|
||||
export function forgiveExit(
|
||||
identity: string | null,
|
||||
note: string,
|
||||
): Promise<{ ok: true; opened: boolean; reason?: string; forgoneMinor?: number; currency?: string }> {
|
||||
return apiFetch("/api/barrier/forgive", { method: "POST", body: JSON.stringify({ ...(identity ? { identity } : {}), note }) });
|
||||
}
|
||||
|
||||
/** Take payment for a session → signed payment event. `overrideMinor` sets an
|
||||
* operator amount (lost ticket / dispute). */
|
||||
export function paySession(
|
||||
|
||||
Reference in New Issue
Block a user