E2-F2: Sales Phase Configuration¶
Epic: E2: Match & Stadium Management
Size: S (Small)
Problem / Outcome¶
Admins need to configure sales phases (Loyalty, General Public) for each match.
Scope¶
In-Scope:
- API to set sales phases per match
- Start/end dates configuration
- Eligibility rules per phase
- Ticket limits per phase
Out-of-Scope:
- Automatic phase transitions (manual or scheduled)
Acceptance Criteria¶
- AC1: Given a match, when admin configures loyalty phase, then start/end dates and eligibility rules are saved
- AC2: Given overlapping phases, when admin saves, then error "Phases cannot overlap" is returned
- AC3: Given phase is active, when user accesses match, then phase-specific rules are enforced
- AC4: Sales closure triggers: all tickets sold (automatic) OR admin manually closes sales
Data Model Impact¶
SalesPhase table:
- id (UUID, PK)
- match_id (UUID, FK)
- phase_type (ENUM: loyalty, general_public)
- start_at (TIMESTAMP)
- end_at (TIMESTAMP)
- eligibility_rules_json (JSONB)
- ticket_limit (INTEGER)
- created_at (TIMESTAMP)
Permissions/Roles¶
- Admin (Match Manager)
How to Verify¶
npm test -- --grep "sales phase"
Expected: Phases saved correctly, overlap validation works.
Dependencies¶
Implementation Tasks¶
See E2: Match ## Doc References Stadium Tasks
Doc References¶
Last Updated: January 2026