E6-F2: Loyalty Early Access Configuration¶
Epic: E6: Loyalty Program
Size: S (Small)
Problem / Outcome¶
Configure loyalty-based early access per match.
Scope¶
In-Scope:
- Early access window dates configuration
- Configurable points-to-allocation mapping per match
- Admin view of user loyalty points for allocation planning
- Hard limit of 4 tickets enforcement
Out-of-Scope:
- Tier-based perks beyond ticket allocation
Acceptance Criteria¶
- AC1: Admin configures early access start/end dates for match
- AC2: Admin configures points-to-allocation thresholds per phase via the tier editor (fully configurable, not hardcoded); a fan gets the allocation of the highest tier their 5-year balance reaches, 0 tickets = no access
- AC3: Admin can view the loyalty points distribution (
GET /admin/loyalty/distribution) — the tier editor shows "N fans qualify" per threshold for allocation planning - AC4: Hard limit of 4 tickets per match enforced across all phases and channels — loyalty purchases count against the public-sale allowance
- AC5: When a LOYALTY phase opens, qualifying fans (lowest tier granting tickets, floor 1 point) receive push + email with a purchase deeplink (
app:notify-phase-start, cron-able, at-most-once per phase, 24h freshness window)
Data Model Impact¶
SalesPhase table:
- eligibility_rules_json contains:
{
"thresholds": [
{"min_points": 27, "max_tickets": 4},
{"min_points": 20, "max_tickets": 3},
{"min_points": 10, "max_tickets": 2},
{"min_points": 0, "max_tickets": 0}
]
}
(legacy flat {"min_points": N, "max_tickets": M} remains accepted)
- start_notified_at (TIMESTAMP, nullable) — phase-open notification marker
LoyaltyTierConfig table dropped
Tiers are configured per phase (a match can have differently-tuned
loyalty phases), so they live inside sales_phases.eligibility_rules_json.
The separate per-match table was removed in July 2026 without ever being
used.
Permissions/Roles¶
- Admin (Match Manager)
How to Verify¶
npm test -- --grep "loyalty early access config"
Expected: Configuration saved and applied during purchase.
Dependencies¶
Implementation Tasks¶
Doc References¶
Last Updated: July 2026