Summary
Build a post-game aggregator that reads completed matchLogs and updates playerProfiles/{playerToken} (Phase 1 key), with did support for Phase 2 migration.
Implementation
- Trigger on match completion (or scheduled processor of completed logs).
- Compute and persist:
- matchesPlayed, wins, losses, winRate
- acpl
- veilRate, opponentVeilRate
- sacrificeRate
- comebackWins
- inversionClause totals (
total, blind, seal)
- Upsert
playerProfiles with createdAt/updatedAt.
- Keep
researchConsent default false.
Acceptance Criteria
- Profile doc updates correctly after a completed match.
- Metrics are deterministic from the same
matchLogs.
- Re-processing is idempotent (no double-counting).
Summary
Build a post-game aggregator that reads completed
matchLogsand updatesplayerProfiles/{playerToken}(Phase 1 key), withdidsupport for Phase 2 migration.Implementation
total,blind,seal)playerProfileswithcreatedAt/updatedAt.researchConsentdefaultfalse.Acceptance Criteria
matchLogs.