feat: cart, checkout, sales lifecycle and tickets (#26) #96
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!96
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/26-transactions-checkout"
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 #26.
What
Server-side cart, idempotent checkout, sale lifecycle and tickets (
internal/sales, ADR 0011).PUT/GET/DELETE /v1/me/cart;POST /v1/me/checkout(requiredIdempotency-Key,payment_methodwallet|mpesa|card) creates a priced Pending sale with seats held.transaction_logs.sales.expirejob runs every minute; pending sales expire aftersale_pending_minutes(default 10).GET /v1/me/transactions(page max 25),/v1/me/transactions/{id},/v1/me/tickets; owner only, other users' rows 404.waiveis refused until #30.Rulings and follow-ups
Completeon a cancelled sale returns the sale with a nil error: callers must checksale.Status; Cancelled means refund (#36).GET /v1/me/ticketsis unpaged.KWS_MODE=worker) must run before checkout goes live; the app DB role must not be owner/superuser. Migration 0017 is new.Verification
go test -race ./...,make lint(0 issues),make contractpass.make cover, minimum 80%).🤖 Generated with Claude Code