feat(checkin): gate check-in/out, ticket activities and QR (#27) #102
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!102
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/27-checkin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #27. Prerequisite for the rest of #36 (overstay, vehicle add-on, ticket top-up).
What
active -> checked_in -> checked_out(andactive -> cancelled), check-in/out time and gate columns,check_in_number(unique, fromnumbering), a strictertickets_guard, and an append-onlyticket_activitieslog.internal/checkin:Service.CheckIn/CheckOut, one transaction per scan, ticket rows locked in id order through an index-friendly query (a plan test guards it), check-in numbers taken last (numbering.TakeN, no gaps on rollback).admin_portal.tickets.scan, Park Management and Super Admin):POST /v1/admin/gates/{id}/check-in,POST /v1/admin/gates/{id}/check-out,GET /v1/admin/tickets/{code}; customer QRGET /v1/me/tickets/{code}/qr(PNG of the bare code, owner only)./v1/me/ticketsexposes the new status and times. OpenAPI and live contract tests; ADR 0017; plandocs/superpowers/plans/2026-10-26-checkin.md.Rulings and known limits (ADR 0017)
checkout_overstay); charging overstay is #36.visit_date; legacy never checked dates. Confirm with the business.visit_date,expires_atandholder_namestay editable by hand-written SQL (known limit g). No vehicle scans, no reports (#38).{code}routes are logged by pattern.Review
Dual pass done. Pass 1: no Must fix. Pass 2 found a full-table-scan lock query and a master scan that failed for sales with several visit dates; both fixed in
edc18eewith the smaller items; Pass 1 re-check: Ship. Open nits: the plan test depends on Postgres planner output; a cancelled master also blocks check-out (cannot happen yet).Checks
make cover: 89.5% (minimum 80%).go test -race ./...,make lint,make contractand client generation green (implementer run); the lock query was measured only in review, not at production scale.Deploy
Run migration 0021. No new environment variables, no worker change. Grant
admin_portal.tickets.scanthrough the Park Management role (re-applied byKWS_MODE=migrate).🤖 Generated with Claude Code