E6-F3: Loyalty Points Award After Match¶
Epic: E6: Loyalty Program
Size: S (Small)
Problem / Outcome¶
Automatically award points after match closure.
Scope¶
In-Scope:
- Trigger on match closure
- Check attendance status
- Award 1 point to eligible fans
- Send notification to awarded fans
Out-of-Scope:
- Manual point adjustment
Acceptance Criteria¶
- AC1: After match closed with attendance, points awarded to fans with ATTENDED status
- AC2: Only paid tickets with valid OIB eligible
- AC3: Push notification: "You earned 1 loyalty point for attending [Match]"
Data Model Impact¶
LoyaltyPoint table:
- Records created for each eligible attendee
LoyaltyAwardBatch table:
- id (UUID, PK)
- match_id (UUID, FK)
- total_awarded (INTEGER)
- processed_at (TIMESTAMP)
- status (ENUM: pending, processing, completed)
Eligibility criteria:
- Ticket.status = ATTENDED
- Ticket.payment_type != FREE
- Ticket.holder_oib IS NOT NULL
Permissions/Roles¶
- System (triggered by match closure)
How to Verify¶
npm test -- --grep "loyalty award"
Expected: Points awarded to correct fans, notifications sent.
Dependencies¶
- E2-F9: Match Closure with Attendance
- E6-F1: Loyalty Points Tracking
- E15-F2: Push Notification Service
Implementation Tasks¶
Doc References¶
Last Updated: January 2026