From 58d764a175b6bca1129fca46689083dc2157dddf Mon Sep 17 00:00:00 2001 From: ngqile Date: Fri, 4 Dec 2026 16:40:02 +0800 Subject: [PATCH] chore(openspec): archive add-event-ticket-orders Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs --- .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../specs/event-attendance/spec.md | 0 .../specs/event-invitations/spec.md | 0 .../specs/event-ticketing/spec.md | 0 .../specs/landing-pages/spec.md | 0 .../sql/01-event-ticket-orders.sql | 0 .../sql/02-event-tickets-module.sql | 0 .../sql/03-ticket-labels.sql | 0 .../sql/99-rollback.sql | 0 .../tasks.md | 2 +- openspec/specs/event-attendance/spec.md | 16 +- openspec/specs/event-invitations/spec.md | 8 +- openspec/specs/event-ticketing/spec.md | 254 ++++++++++++++++++ openspec/specs/landing-pages/spec.md | 30 +++ 16 files changed, 299 insertions(+), 11 deletions(-) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/.openspec.yaml (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/design.md (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/proposal.md (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/specs/event-attendance/spec.md (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/specs/event-invitations/spec.md (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/specs/event-ticketing/spec.md (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/specs/landing-pages/spec.md (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/sql/01-event-ticket-orders.sql (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/sql/02-event-tickets-module.sql (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/sql/03-ticket-labels.sql (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/sql/99-rollback.sql (100%) rename openspec/changes/{add-event-ticket-orders => archive/2026-12-04-add-event-ticket-orders}/tasks.md (99%) create mode 100644 openspec/specs/event-ticketing/spec.md diff --git a/openspec/changes/add-event-ticket-orders/.openspec.yaml b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/.openspec.yaml similarity index 100% rename from openspec/changes/add-event-ticket-orders/.openspec.yaml rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/.openspec.yaml diff --git a/openspec/changes/add-event-ticket-orders/design.md b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/design.md similarity index 100% rename from openspec/changes/add-event-ticket-orders/design.md rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/design.md diff --git a/openspec/changes/add-event-ticket-orders/proposal.md b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/proposal.md similarity index 100% rename from openspec/changes/add-event-ticket-orders/proposal.md rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/proposal.md diff --git a/openspec/changes/add-event-ticket-orders/specs/event-attendance/spec.md b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/specs/event-attendance/spec.md similarity index 100% rename from openspec/changes/add-event-ticket-orders/specs/event-attendance/spec.md rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/specs/event-attendance/spec.md diff --git a/openspec/changes/add-event-ticket-orders/specs/event-invitations/spec.md b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/specs/event-invitations/spec.md similarity index 100% rename from openspec/changes/add-event-ticket-orders/specs/event-invitations/spec.md rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/specs/event-invitations/spec.md diff --git a/openspec/changes/add-event-ticket-orders/specs/event-ticketing/spec.md b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/specs/event-ticketing/spec.md similarity index 100% rename from openspec/changes/add-event-ticket-orders/specs/event-ticketing/spec.md rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/specs/event-ticketing/spec.md diff --git a/openspec/changes/add-event-ticket-orders/specs/landing-pages/spec.md b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/specs/landing-pages/spec.md similarity index 100% rename from openspec/changes/add-event-ticket-orders/specs/landing-pages/spec.md rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/specs/landing-pages/spec.md diff --git a/openspec/changes/add-event-ticket-orders/sql/01-event-ticket-orders.sql b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/sql/01-event-ticket-orders.sql similarity index 100% rename from openspec/changes/add-event-ticket-orders/sql/01-event-ticket-orders.sql rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/sql/01-event-ticket-orders.sql diff --git a/openspec/changes/add-event-ticket-orders/sql/02-event-tickets-module.sql b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/sql/02-event-tickets-module.sql similarity index 100% rename from openspec/changes/add-event-ticket-orders/sql/02-event-tickets-module.sql rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/sql/02-event-tickets-module.sql diff --git a/openspec/changes/add-event-ticket-orders/sql/03-ticket-labels.sql b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/sql/03-ticket-labels.sql similarity index 100% rename from openspec/changes/add-event-ticket-orders/sql/03-ticket-labels.sql rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/sql/03-ticket-labels.sql diff --git a/openspec/changes/add-event-ticket-orders/sql/99-rollback.sql b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/sql/99-rollback.sql similarity index 100% rename from openspec/changes/add-event-ticket-orders/sql/99-rollback.sql rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/sql/99-rollback.sql diff --git a/openspec/changes/add-event-ticket-orders/tasks.md b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/tasks.md similarity index 99% rename from openspec/changes/add-event-ticket-orders/tasks.md rename to openspec/changes/archive/2026-12-04-add-event-ticket-orders/tasks.md index f264277..0ba0e4f 100644 --- a/openspec/changes/add-event-ticket-orders/tasks.md +++ b/openspec/changes/archive/2026-12-04-add-event-ticket-orders/tasks.md @@ -175,5 +175,5 @@ Design: `design.md` (technical contracts) and `docs/superpowers/specs/2026-12-04 - Check the blocked paths: over 10 tickets, sold out, missing consent, and an unknown order link. - Take screenshots. - Depends on: 4.2 -- [ ] 5.2 Write the release note in `docs/deployment.md`. Open the PR to main and merge it, then archive the change in its own PR. +- [x] 5.2 Write the release note in `docs/deployment.md`. Open the PR to main and merge it, then archive the change in its own PR. - Depends on: 5.1 diff --git a/openspec/specs/event-attendance/spec.md b/openspec/specs/event-attendance/spec.md index 358e5ea..d9613be 100644 --- a/openspec/specs/event-attendance/spec.md +++ b/openspec/specs/event-attendance/spec.md @@ -118,15 +118,7 @@ A guest's status SHALL be derived from the event lead it is linked to: Registere ### Requirement: Event attendance numbers -The event page SHALL show: - -- invited: the number of guests, against the invitation cap when set; -- registered: guests linked to an event lead; -- attended: attended event leads; -- walk-ins: event leads not linked to a guest; -- total: registered guests plus walk-ins, against capacity when set. - -The numbers SHALL agree with the guest list and the event leads listing. A total above capacity SHALL be shown, not hidden. +The event page SHALL show invited guests (against the cap), registered guests, attended event leads, walk-ins (event leads linked to no guest and not created by a ticket order), held tickets (only when the event sells tickets), and a total of registered plus walk-ins plus held tickets (against capacity). The numbers SHALL agree with the guest list and event leads listing, and a total above capacity SHALL be shown. #### Scenario: Numbers @@ -134,6 +126,12 @@ The numbers SHALL agree with the guest list and the event leads listing. A total - **WHEN** an admin opens the event page - **THEN** the event page shows invited 40 of 50, registered 30, attended 35, walk-ins 15, total 45 of 100 +#### Scenario: Ticket buyers are not walk-ins + +- **GIVEN** `KL Hotel Tech Day` has 2 walk-ins, and a buyer whose order holds 3 tickets +- **WHEN** an admin opens the event page +- **THEN** the page shows walk-ins 2, held tickets 3, total 5 + ### Requirement: Check-in abuse limits The check-in endpoints SHALL allow at most 300 lookups and submissions per IP per event per 10 minutes, answering "Too many attempts. Try again later." beyond that. The IP SHALL be determined as on the QR page. The check-in page SHALL NOT count against the QR page-load limit. diff --git a/openspec/specs/event-invitations/spec.md b/openspec/specs/event-invitations/spec.md index d3b6e36..5cd2a32 100644 --- a/openspec/specs/event-invitations/spec.md +++ b/openspec/specs/event-invitations/spec.md @@ -152,7 +152,7 @@ An accepted invite submission SHALL register the guest with the same normalisati ### Requirement: Capacity before the event -When an event has a capacity, invite registrations SHALL be refused before the event days once the number of registered guests plus walk-in event leads reaches it. A refused registration SHALL show "This event is full". On the event days (Malaysia, from the start date through the end date) no registration or check-in SHALL be refused for capacity. Staff capture SHALL never be refused for capacity. +When an event has a capacity, invite registrations and ticket requests SHALL be refused before the event days once registered guests plus walk-in event leads plus held tickets would exceed it; an invite shows "This event is full". On the event days (Malaysia, start through end date) nothing SHALL be refused for capacity, though ticket types keep their own seats. Staff capture SHALL never be refused for capacity. #### Scenario: Full before the event @@ -166,6 +166,12 @@ When an event has a capacity, invite registrations SHALL be refused before the e - **WHEN** the third guest submits their invite - **THEN** they are registered +#### Scenario: Held tickets fill the event + +- **GIVEN** `KL Expo` starts next week, has capacity 10, one registered guest and 9 held tickets +- **WHEN** another guest submits their invite +- **THEN** the page says the event is full and nothing is saved + ### Requirement: Guest list access Users with `BO_EVENTS` SHALL see an event's guest list with each guest's status, invite sent count and salesperson. Only users with `BO_EVENT_GUESTS` SHALL add, paste, remove, copy links for or send invites to guests. Guest endpoints SHALL apply the company scope as everywhere: staff only reach their company's events. diff --git a/openspec/specs/event-ticketing/spec.md b/openspec/specs/event-ticketing/spec.md new file mode 100644 index 0000000..2e3a369 --- /dev/null +++ b/openspec/specs/event-ticketing/spec.md @@ -0,0 +1,254 @@ +# event-ticketing Specification + +## Purpose + +Event ticket sales with payment outside Co-Lite: per-event ticket settings and types, buyer ticket requests from a landing page's Tickets section with seat holds, the buyer's order page and emails, hold expiry, and the staff order screens that mark orders paid or cancel orders and tickets. + +## Requirements + +### Requirement: Ticket Settings On An Event + +An event SHALL have a Tickets switch that is off by default, payment instructions of up to 1000 characters, and hold days from 1 to 14 that default to 3. Only users with `BO_EVENT_TICKETS` SHALL change them. While the switch is off, the event SHALL behave as it did before this change, and no ticket order SHALL be accepted for it. Turning the switch on SHALL require payment instructions. + +#### Scenario: Turn tickets on + +- **WHEN** a user with `BO_EVENT_TICKETS` turns Tickets on for `KL Hotel Tech Day` with payment instructions `Maybank 5140 1234 5678, ref your order number` and hold days 3 +- **THEN** the event shows Tickets on with those instructions and 3 hold days + +#### Scenario: Instructions required + +- **WHEN** a user turns Tickets on with empty payment instructions +- **THEN** the save is refused on the payment instructions field and nothing changes + +#### Scenario: Hold days out of range + +- **WHEN** a user saves hold days 15 +- **THEN** the save is refused on the hold days field + +#### Scenario: Without the permission + +- **GIVEN** a user has `BO_EVENTS` but not `BO_EVENT_TICKETS` +- **WHEN** they open the event +- **THEN** they do not see the Tickets section + +### Requirement: Ticket Types + +A ticketed event SHALL have zero or more ticket types. Each type SHALL have a name of 1 to 80 characters unique within the event, a price in MYR from 0.00 to 99999.99 in whole sen, a quantity of at least 1, an optional sales end date (empty means the event's end date), a sort order and an enabled flag. + +#### Scenario: Add types + +- **WHEN** staff add `Early bird` at RM 150.00 quantity 20 and `General` at RM 250.00 quantity 100 +- **THEN** both types are listed in sort order with their prices and 20 and 100 seats left + +### Requirement: Ticket Type Changes + +A type with any order SHALL NOT be deleted, only disabled. A type's quantity SHALL NOT be set below the seats it holds. A price change SHALL apply only to orders made after it. + +#### Scenario: Type with orders cannot be deleted + +- **GIVEN** `Early bird` has an order +- **WHEN** staff delete it +- **THEN** the delete is refused with "This ticket type has orders. Disable it instead." + +#### Scenario: Quantity below held seats + +- **GIVEN** `Early bird` holds 12 seats +- **WHEN** staff set its quantity to 10 +- **THEN** the save is refused on the quantity field + +#### Scenario: Price change keeps old orders + +- **GIVEN** an order holds 2 `General` tickets at RM 250.00 +- **WHEN** staff change `General` to RM 280.00 +- **THEN** that order still totals RM 500.00 + +### Requirement: Seats Held + +A ticket SHALL hold a seat while its order is Awaiting payment or Paid and the ticket is not cancelled. A type's seats left SHALL be its quantity minus the seats it holds. Requests SHALL never cause a type to hold more seats than its quantity, including when requests arrive at the same moment. When the event has a capacity, a request made before the event days SHALL be refused if held tickets plus registered guests plus walk-in event leads would exceed it. + +#### Scenario: Last seat taken once + +- **GIVEN** `VIP` has 1 seat left +- **WHEN** two visitors request 1 `VIP` ticket at the same moment +- **THEN** one order is created and the other request is told `VIP` has only 0 left + +#### Scenario: Expired order frees seats + +- **GIVEN** an Awaiting-payment order holds 3 `General` tickets +- **WHEN** it expires +- **THEN** `General` shows 3 more seats left + +#### Scenario: Event capacity + +- **GIVEN** `KL Hotel Tech Day` starts next week with capacity 50, 45 held tickets and 3 registered guests +- **WHEN** a visitor requests 3 tickets +- **THEN** the request is refused with "Only 2 places are left for this event" + +### Requirement: Ticket Request + +A ticket request SHALL carry a quantity per ticket type from 0 to 10 with a total from 1 to 10, the buyer's name and email (both required), an optional mobile and company, and the privacy notice consent (required). Inputs SHALL be normalised and limited as in staff capture. An accepted request SHALL create one order with a line per type keeping its name and price at the time, one ticket per seat, an order reference unique within the company, and an unguessable link token. + +#### Scenario: Request two types + +- **WHEN** a visitor requests 2 `General` and 1 `VIP` as `Aisyah`, `aisyah@example.test`, and ticks the consent +- **THEN** an order with 3 tickets totalling RM 1000.00 is Awaiting payment +- **AND** the thank-you shows its reference, lines, total, payment instructions, hold expiry and a "View your order" link + +#### Scenario: Missing email or consent + +- **WHEN** a visitor submits without an email, or without ticking the consent +- **THEN** nothing is saved and the error shows under that field + +### Requirement: Ticket Request Refusals + +A request SHALL be refused, saving nothing, when a requested type is disabled, past its sales end date or short of seats, naming the type and its seats left. A request SHALL be accepted only while the event has Tickets on, is enabled, has not passed its end date in Malaysia time, and its company has a privacy notice. + +#### Scenario: Over ten + +- **WHEN** a visitor requests 11 tickets +- **THEN** the request is refused and nothing is saved + +#### Scenario: Sales ended for a type + +- **GIVEN** `Early bird` sales ended yesterday +- **WHEN** a visitor requests 1 `Early bird` +- **THEN** the request is refused naming `Early bird` + +#### Scenario: Tickets turned off + +- **GIVEN** staff turned Tickets off for `KL Hotel Tech Day` +- **WHEN** a visitor submits a request +- **THEN** the request is refused and nothing is saved + +### Requirement: Free Orders + +An order whose total is RM 0.00 SHALL be Paid when it is created, without staff action. Its thank-you page and email SHALL say the order is confirmed and SHALL NOT show payment instructions. + +#### Scenario: Free ticket type + +- **GIVEN** `Community pass` is priced RM 0.00 +- **WHEN** a visitor requests 2 `Community pass` +- **THEN** the order is Paid at once and the thank-you says it is confirmed + +### Requirement: Awaiting-Payment Limit Per Buyer + +An email SHALL have at most 3 orders Awaiting payment per event. A further request SHALL be refused with "You already have orders awaiting payment for this event." and nothing SHALL be saved. + +#### Scenario: Fourth unpaid order + +- **GIVEN** `aisyah@example.test` has 3 orders Awaiting payment for `KL Hotel Tech Day` +- **WHEN** she requests another ticket +- **THEN** the request is refused with that message + +### Requirement: Order States + +An order SHALL be in one of four states: + +- **Awaiting payment.** +- **Paid.** +- **Cancelled.** +- **Expired.** + +An order Awaiting payment SHALL hold its seats until its hold expiry, which is the creation time plus the event's hold days at the time of the request. After the hold expiry it SHALL become Expired within 15 minutes. Paid, Cancelled and Expired orders SHALL never expire. + +#### Scenario: Hold runs out + +- **GIVEN** an order made on 1 December at 10:00 with 3 hold days is still Awaiting payment +- **WHEN** it is 4 December 10:15 +- **THEN** the order is Expired and its seats are free + +### Requirement: Buyer Becomes An Event Lead + +An accepted request SHALL match the buyer to a lead with the QR registration rules, including the existing-lead notes, and create the buyer's event lead with source TICKET, no salesperson, the consent time and notice version, and the page address and UTM values as for a FORM block. A buyer already captured at the event SHALL change nothing on that event lead except a note naming the order reference. These event leads SHALL appear in every lead listing, export and the dashboard. + +#### Scenario: New buyer + +- **WHEN** `Aisyah`, unknown to INS, requests tickets +- **THEN** staff see `Aisyah` in the event's leads with source Ticket, NEW and OPEN + +#### Scenario: Buyer already captured + +- **GIVEN** `Aisyah` registered at `KL Hotel Tech Day` through the QR code +- **WHEN** she requests tickets +- **THEN** her event lead keeps source QR, and its notes name the order reference + +### Requirement: Order Page + +The order link `/o/` SHALL show: + +- the event's name, dates and location; +- the order reference, lines, total, state and creation time; +- while Awaiting payment, the payment instructions and hold expiry. + +It SHALL show the buyer's name but no other personal details. An unknown token SHALL show "This order link is not valid." The page SHALL be limited to 120 loads per IP per 10 minutes. + +#### Scenario: Unpaid order page + +- **GIVEN** order `T-7K3M9Q` is Awaiting payment +- **WHEN** the buyer opens its link +- **THEN** the page shows the lines, total, payment instructions and hold expiry + +#### Scenario: Unknown link + +- **WHEN** a visitor opens `/o/` with an unknown token +- **THEN** the page says the order link is not valid and shows nothing else + +### Requirement: Order Emails + +The buyer SHALL get an email when their order is created (lines, total, payment instructions, hold expiry and order link), becomes Paid (a confirmation with lines, total and order link), Expires, or is Cancelled by staff. Each email SHALL be recorded in Emails. A failed send SHALL NOT undo the order change, and staff SHALL be able to resend the latest email of an order. + +#### Scenario: Order received email + +- **WHEN** `Aisyah` requests tickets +- **THEN** she receives an email with the order reference, payment instructions, hold expiry and order link + +#### Scenario: Paid email + +- **WHEN** staff mark her order Paid +- **THEN** she receives a confirmation email + +### Requirement: Staff Order Screens + +The event's Tickets section SHALL list the event's orders with reference, buyer name, email, ticket count, total, state and creation time, newest first in pages of 50, filterable by state and searchable by reference, name, email or mobile. The order detail SHALL show the lines, tickets, buyer details, payment reference, and who changed the state and when. A user without `BO_EVENT_TICKETS` SHALL NOT see or reach these screens. + +#### Scenario: Company separation + +- **WHEN** INS staff open an order of a CV event by its address +- **THEN** they get not found + +### Requirement: Staff Order Actions + +Users with `BO_EVENT_TICKETS` SHALL be able to mark an order paid with an optional payment reference of up to 100 characters (when Awaiting payment, or Expired with all its seats still available), cancel an order that is Awaiting payment or Paid (freeing its seats), cancel one ticket of such an order that has another uncancelled ticket (freeing the seat and lowering the total), and resend the latest order email. Each action SHALL be written to the admin audit log. + +#### Scenario: Mark paid with reference + +- **GIVEN** order `T-7K3M9Q` is Awaiting payment +- **WHEN** staff mark it paid with reference `MBB 0412 883` +- **THEN** the order is Paid with that reference, their name and the time +- **AND** the audit log records the action + +#### Scenario: Expired order after its seats were taken + +- **GIVEN** order `T-7K3M9Q` expired, and its `VIP` seat was then taken by another order +- **WHEN** staff mark it paid +- **THEN** the action is refused with "Not enough seats left to confirm this order" and the order stays Expired + +#### Scenario: Cancel one ticket + +- **GIVEN** a Paid order holds 3 `General` tickets at RM 250.00 +- **WHEN** staff cancel one ticket +- **THEN** the order holds 2 tickets, totals RM 500.00, and `General` has one more seat left + +### Requirement: Ticket Request Abuse Limits + +Ticket requests SHALL follow the QR registration limits: at most 60 requests per client IP per event in 10 minutes, answered above the limit with "Too many registrations from this device. Try again later." A request that fills the hidden honeypot field SHALL get the normal thank-you page and save nothing. + +#### Scenario: Too many requests + +- **WHEN** one IP submits 61 ticket requests for an event within 10 minutes +- **THEN** the 61st is refused with "Too many registrations from this device. Try again later." + +#### Scenario: Honeypot filled + +- **WHEN** a request fills the hidden honeypot field +- **THEN** the thank-you page shows and no order is saved diff --git a/openspec/specs/landing-pages/spec.md b/openspec/specs/landing-pages/spec.md index 67cd112..b6c47ba 100644 --- a/openspec/specs/landing-pages/spec.md +++ b/openspec/specs/landing-pages/spec.md @@ -846,3 +846,33 @@ A page with a top bar, a full-width hero with its sign-up form, and a trust stri - **WHEN** a visitor opens a landing page with a sign-up form - **THEN** each text field, the service dropdown and the Register button are at least 44 px tall + +### Requirement: Tickets Block + +A page MAY hold TICKETS blocks. The page SHALL show each enabled ticket type of the block's event in sort order with its name, its price as `RM 150.00` or `Free`, and its seats left or "Sold out" or "Sales ended", a quantity picker per type with an order total of at most 10, the running total, the buyer's fields and the privacy consent. When the event no longer accepts requests, the block SHALL say ticket sales are closed and the rest of the page SHALL still show. + +#### Scenario: Visitor sees ticket types + +- **GIVEN** a published page with a TICKETS block for `KL Hotel Tech Day`, whose types are `Early bird` RM 150.00 with 12 left, `General` RM 250.00 with 80 left, and `VIP` RM 500.00 sold out +- **WHEN** a visitor opens the page +- **THEN** the block lists the three types with their prices, shows "Sold out" for `VIP`, and offers no quantity for `VIP` + +#### Scenario: Sales closed + +- **GIVEN** the event of a TICKETS block ended yesterday +- **WHEN** a visitor opens the page +- **THEN** the block says ticket sales are closed and the other blocks still show + +### Requirement: Tickets Block Fields + +A TICKETS block SHALL name one event of the page's company that is enabled, not ended and has Tickets on when saved. It MAY have a heading (120 characters), text (1000 characters), a section label, a look and a link name. The server SHALL refuse any other field. Both editors SHALL offer the block and pick its event from the company's events that qualify. + +#### Scenario: Event without tickets + +- **WHEN** staff save a TICKETS block for an event whose Tickets switch is off +- **THEN** the save is refused on that block's event field + +#### Scenario: Add a tickets block in the editor + +- **WHEN** staff add a Tickets section in the on-page editor and pick `KL Hotel Tech Day` +- **THEN** the canvas shows that event's ticket types