feat(tickets): event ticket orders (add-event-ticket-orders) #85

Merged
ngqile merged 12 commits from add-event-ticket-orders into main 2026-12-04 08:39:29 +00:00
Owner

First of two ticketing changes (design: docs/superpowers/specs/2026-12-04-event-ticketing-design.md). Payment happens outside Co-Lite; staff mark orders paid.

What

  • Event settings: Sell tickets switch, payment instructions, hold days; ticket types with price (sen), quantity, sales end.
  • Orders: a public request through a landing page's new Tickets section. It locks the event row while counting seats, caps 10 tickets per order and 3 unpaid orders per email per event, and makes the buyer an event lead (source TICKET). RM 0 orders are paid at once.
  • Order page /o/<token>: status, lines, payment instructions and pay-by time while awaiting.
  • Emails: order received, paid, expired and cancelled. An expiry job runs every 10 minutes with a conditional update, so it is safe across replicas.
  • Staff: a Tickets card on the event; orders list and detail with mark paid, cancel order, cancel ticket and resend. Permission BO_EVENT_TICKETS.
  • Gateway: opens the three public ticket paths.
  • Labels: English and zh-CN, with sql/03-ticket-labels.sql.

Verification

  • mvn verify passes for services-counter, mobile-api and api-gateway.
  • Portal: vitest 306 files passing (exit 0), tsc clean, lint has 0 errors.
  • Local stack: services rebuilt and the counter booted, which validates its JPQL. Two parallel requests for the last seat: one order, one 409 TYPE_UNAVAILABLE.
  • Playwright (local), signed in through the form and navigated by clicking:
    • Turned tickets on and added types.
    • The Tickets section picker lists only events that sell tickets; the canvas preview works.
    • Checked the validation errors, the stepper capped at seats left, a RM 450 order with its thank-you and order page, sold out, a bad order link, and a free order confirmed at once.
    • Staff screens: mark paid, then cancel a ticket with confirm; the total dropped to RM 300.
    • Test buyer was a made-up local buyer the owner approved.
  • Not checked live:
    • The over-10 cap: the test types had only 8 seats. Unit tests cover it.
    • Real email delivery: local Mailjet keys are absent, so the email service received the sends but Mailjet refused them.

Deploy

See docs/deployment.md §13: run SQL 01 and 02 first, then deploy counter, mobile-api, gateway and portal, then SQL 03.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs

First of two ticketing changes (design: `docs/superpowers/specs/2026-12-04-event-ticketing-design.md`). Payment happens outside Co-Lite; staff mark orders paid. ## What - **Event settings:** Sell tickets switch, payment instructions, hold days; ticket types with price (sen), quantity, sales end. - **Orders:** a public request through a landing page's new **Tickets** section. It locks the event row while counting seats, caps 10 tickets per order and 3 unpaid orders per email per event, and makes the buyer an event lead (source TICKET). RM 0 orders are paid at once. - **Order page** `/o/<token>`: status, lines, payment instructions and pay-by time while awaiting. - **Emails:** order received, paid, expired and cancelled. An expiry job runs every 10 minutes with a conditional update, so it is safe across replicas. - **Staff:** a Tickets card on the event; orders list and detail with mark paid, cancel order, cancel ticket and resend. Permission `BO_EVENT_TICKETS`. - **Gateway:** opens the three public ticket paths. - **Labels:** English and zh-CN, with `sql/03-ticket-labels.sql`. ## Verification - `mvn verify` passes for services-counter, mobile-api and api-gateway. - Portal: vitest 306 files passing (exit 0), tsc clean, lint has 0 errors. - **Local stack:** services rebuilt and the counter booted, which validates its JPQL. Two parallel requests for the last seat: one order, one 409 `TYPE_UNAVAILABLE`. - **Playwright (local)**, signed in through the form and navigated by clicking: - Turned tickets on and added types. - The Tickets section picker lists only events that sell tickets; the canvas preview works. - Checked the validation errors, the stepper capped at seats left, a RM 450 order with its thank-you and order page, sold out, a bad order link, and a free order confirmed at once. - Staff screens: mark paid, then cancel a ticket with confirm; the total dropped to RM 300. - Test buyer was a made-up local buyer the owner approved. - Not checked live: - The over-10 cap: the test types had only 8 seats. Unit tests cover it. - Real email delivery: local Mailjet keys are absent, so the email service received the sends but Mailjet refused them. ## Deploy See `docs/deployment.md` §13: run SQL 01 and 02 first, then deploy counter, mobile-api, gateway and portal, then SQL 03. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
ngqile added 12 commits 2026-12-04 08:39:26 +00:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
ngqile merged commit 2d95dc203c into main 2026-12-04 08:39:29 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ngqile/co-lite#85