Preskoči na sadržaj

E6: Loyalty Program - Tasks

Epic: E6: Loyalty Program


E6-F1: Loyalty Points Tracking

Feature: E6-F1: Loyalty Points Tracking

Status Task Verification
Create LoyaltyPoint database migration (id, user_id, match_id, match_type, earned_at) Run migrations
Implement points balance calculation (count where earned_at > 5 years ago) Rolling window works
Implement GET /users/me/loyalty endpoint Returns balance
Implement GET /users/me/loyalty/history endpoint for points history Returns match-by-match history
Implement GET /admin/users/{id}/loyalty endpoint for admin view Admin can view any user's points
Support both HOME and AWAY match types for points earning Both match types earn points
Add "My Loyalty Status" section to Ticketing Profile screen (mobile) Points displayed in profile
Implement Loyalty Points History screen (mobile) History shows match-by-match breakdown
Display 5-year rolling window indicator in Points History Info note displayed
Hide tier-specific allocation info from user profile (HNS determines per match) No tier info shown in profile

E6-F2: Loyalty Early Access Configuration

Feature: E6-F2: Loyalty Early Access Configuration

Status Task Verification
Add loyalty tier configuration (points_threshold -> ticket_limit) as configurable per match Config stored per match
Store loyalty tiers in SalesPhase.eligibility_rules_json JSON schema valid
Implement admin endpoint to view user loyalty points for allocation planning Admin can view distribution
Enforce hard limit of 4 tickets per match across all phases Exceeding limit blocked

E6-F3: Loyalty Points Award After Match

Feature: E6-F3: Loyalty Points Award After Match

Status Task Verification
Trigger job after match closure Job runs
Query tickets with status=ATTENDED and valid OIB (both HOME and AWAY matches) Correct tickets queried
Award 1 point per eligible ticket LoyaltyPoint records created
Send push notification: "You earned 1 point" Notification sent

Last Updated: January 2026