feat: gate group review (scan, review, confirm) and sunlight look #174

Merged
amiryahaya merged 17 commits from feat/gate-group-review into main 2026-11-08 02:45:25 +01:00
Owner

Gate app, second slice (#69): scan -> review the whole group -> confirm, with the sunlight look. Spec docs/superpowers/specs/2026-11-07-gate-group-review-design.md, ADR 0039.

What changes

  • API: POST /v1/admin/gates/{id}/group, .../group/check-in, .../group/check-out. Same permissions as gate scans, scan rate class.
    • One scan shows the master family, the sale's vehicles, and completed vehicle add-on vehicles.
    • Lines are identified by ticket id; no code beyond the scanned one is returned.
    • Confirm is all or nothing (at most 200 lines), re-checked under the family lock. The review read takes no lock.
    • Refusals: 409 on lines[i].
  • Vehicles and boats need a registration at entry. A missing visitor nationality can be filled in at the gate (display only, [verify]).
  • Storage: both are stored append-only in ticket_gate_details (migration 0043). The table is not audited and is purged with completed sales' visitor answers after 7 years, on the ticket's own checkout date.
  • Exit: overstayed lines cannot be ticked; the group goes to the office to pay.
  • Tablet app (mobile/pos): review screen (untick, plate entry, nationality picker, overstay red) and the sunlight theme.
  • The old per-code routes still refuse vehicle tickets (vehicle_ticket).

Checks

  • make cover: 91.8% total (minimum 80%). make lint: 0 issues. make contract: ok.
  • mobile/pos: lintDebug, testDebugUnitTest, koverVerify, assembleDebug; connectedDebugAndroidTest passed on the kws_tablet30 emulator.
  • Dual-pass review: ponytail, then the full correctness review. No must-fix findings; the fixes are in the last commits.

For the owner

  • The "go" green is #08622A, not the mockup's #0A6B2E, which fails 7:1 contrast for sunlight.
  • Filling a missing nationality at the gate is [verify].
  • The screens have not been compared visually with the mockup.
  • Known small gaps:
    • A cancelled or replaced code still opens its group.
    • A master-only group returns an empty list.
    • The confirm routes are not idempotent, same as the existing scans.

🤖 Generated with Claude Code

Gate app, second slice (#69): scan -> review the whole group -> confirm, with the sunlight look. Spec `docs/superpowers/specs/2026-11-07-gate-group-review-design.md`, ADR 0039. ## What changes - **API:** `POST /v1/admin/gates/{id}/group`, `.../group/check-in`, `.../group/check-out`. Same permissions as gate scans, `scan` rate class. - One scan shows the master family, the sale's vehicles, and completed vehicle add-on vehicles. - Lines are identified by ticket id; no code beyond the scanned one is returned. - Confirm is all or nothing (at most 200 lines), re-checked under the family lock. The review read takes no lock. - Refusals: 409 on `lines[i]`. - **Vehicles and boats** need a registration at entry. A missing visitor nationality can be filled in at the gate (display only, [verify]). - **Storage:** both are stored append-only in `ticket_gate_details` (migration 0043). The table is not audited and is purged with completed sales' visitor answers after 7 years, on the ticket's own checkout date. - **Exit:** overstayed lines cannot be ticked; the group goes to the office to pay. - **Tablet app (`mobile/pos`):** review screen (untick, plate entry, nationality picker, overstay red) and the sunlight theme. - The old per-code routes still refuse vehicle tickets (`vehicle_ticket`). ## Checks - `make cover`: **91.8%** total (minimum 80%). `make lint`: 0 issues. `make contract`: ok. - `mobile/pos`: lintDebug, testDebugUnitTest, koverVerify, assembleDebug; `connectedDebugAndroidTest` passed on the `kws_tablet30` emulator. - Dual-pass review: ponytail, then the full correctness review. No must-fix findings; the fixes are in the last commits. ## For the owner - The "go" green is **#08622A**, not the mockup's #0A6B2E, which fails 7:1 contrast for sunlight. - Filling a missing nationality at the gate is **[verify]**. - The screens have not been compared visually with the mockup. - Known small gaps: - A cancelled or replaced code still opens its group. - A master-only group returns an empty list. - The confirm routes are not idempotent, same as the existing scans. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /v1/admin/gates/{id}/group, .../group/check-in and .../group/check-out
expose checkin.Service's group review: same guard and no-store as the scan
routes, Scan rate class, group_in/group_out scan metrics, no ticket code in
any body. Refused lines are a 409 with one lines[i] error each; bad input a
422 on the request field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Group uses ReadGroup (same SQL as LockGroup, no FOR UPDATE) so tablets reviewing one group do not queue; GroupLines selects only the fields the review needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(api): a repeated check-out ticket id is a 422 on ticket_ids[i]
All checks were successful
clients / clients (pull_request) Successful in 2m6s
web-partner / web-partner (pull_request) Successful in 3m28s
mobile-ticket / mobile-ticket (pull_request) Successful in 13m43s
web-admin / web-admin (pull_request) Successful in 8m52s
mobile-pos / mobile-pos (pull_request) Successful in 15m43s
web-ticket / web-ticket (pull_request) Successful in 5m26s
api / api (pull_request) Successful in 20m47s
95f633c62d
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
primatekuntech/kws!174
No description provided.