feat(vehicle-addon): vehicle add-on sales and standalone vehicle tickets (#36) #105
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!105
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/36-vehicle-addon"
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?
Vehicle add-on slice of #36. Does not close #36 (ticket top-up/upgrade is still open).
What it does
POST /v1/admin/transactions/{id}/vehicle-add-ons(Idempotency-Keyrequired, permissionadmin_portal.tickets.scan). It creates a child saletype = 'vehicle_add_on'priced by the server for the visit's whole stay, in the parent's currency. The customer pays (wallet or M-Pesa) or Finance waives it.vehicleticket per unit (no master, noparent_ticket_id). Master scans never move them; gate scans refuse a vehicle code (409vehicle_ticket) until vehicle check-in exists.park_entryunder the master). The master's dates come from the person lines.transactions_add_on_shape,sale_bad_parent,tickets_master_parent,vehicleactivity type); ADR 0019; OpenAPI operation plus live contract test; CLAUDE.md "Vehicle add-on" section.[verify] items for the owner
Server pricing and issuing at all (legacy did neither); no plate captured; buyer is the parent's buyer, not a new guest; whole-stay charge including past days; no promo on add-ons; several add-ons per parent allowed.
Known limits (ADR 0019)
Vehicle-only cart still gets a master with no children (h); a pending add-on can be paid after the master is checked out (i); a plain checkout takes the product type at issue time (j); a product retype in a narrow window is a 500, not a 422 (k). Down migration fails once add-on data exists (test databases only).
Review (dual pass)
401e588with a regression test. Minor items fixed or documented.Verification
go test -race ./...green,make lint0 issues,make contractok, clients generated,make cover: total coverage 90.3% (minimum 80%).Deploy
Run migration 0023 (
KWS_MODE=migrate). No new environment variables. The worker must be running (as for checkout).🤖 Generated with Claude Code