Radosław Gierwiało
aef1a35ee2
feat(matching): implement 3-tier account system with fairness-based recording assignment
Add account tier system (BASIC/SUPPORTER/COMFORT) to reduce recording burden
for premium users while maintaining fairness through karma-based assignment.
Database Changes:
- Add AccountTier enum (BASIC, SUPPORTER, COMFORT)
- Add User.accountTier with BASIC default
- Add User.recordingsDone and User.recordingsReceived for karma tracking
- Add EventParticipant.accountTierOverride for event-specific tier upgrades
- Migration: 20251129220604_add_account_tiers_and_recording_stats
Matching Algorithm Updates:
- Implement fairness debt calculation: receivedCount - doneCount
- Apply tier penalties: SUPPORTER (-10), COMFORT (-50)
- New sorting priority: Location > Fairness > Load balancing
- Add getEffectiveTier() helper for tier resolution with override support
- Add getRecordingStatsForUsers() for fetching karma statistics
Tier Behavior:
- BASIC: Normal recording frequency (baseline, no penalty)
- SUPPORTER: Moderately reduced frequency (fairness penalty -10)
- COMFORT: Significantly reduced frequency (fairness penalty -50)
- All tiers can still be assigned when no better candidates available
Constants:
- ACCOUNT_TIER enum in src/constants/tiers.js
- FAIRNESS_SUPPORTER_PENALTY = 10
- FAIRNESS_COMFORT_PENALTY = 50
Tests:
- Update tests for dual buffer system semantics
- All 30 tests passing
- Fix imports: HEAT_BUFFER → HEAT_BUFFER_BEFORE
2025-11-29 23:19:41 +01:00
..
2025-11-19 20:16:05 +01:00
2025-11-12 21:56:11 +01:00
2025-11-13 15:47:54 +01:00
2025-11-13 20:47:57 +01:00
2025-11-13 20:57:43 +01:00
2025-11-13 21:18:15 +01:00
2025-11-13 21:43:58 +01:00
2025-11-14 14:11:24 +01:00
2025-11-14 15:32:40 +01:00
2025-11-14 22:22:11 +01:00
2025-11-21 21:46:00 +01:00
2025-11-23 17:55:25 +01:00
2025-11-23 18:32:14 +01:00
2025-11-23 19:05:25 +01:00
2025-11-29 23:19:41 +01:00
2025-11-12 21:56:11 +01:00