Background
`src/matches/entities/match.entity.
Goal
Add home_score, away_score, and points_multiplier to Match, write a
migration, and update the indexer to capture and persist them.
Tasks
- Entity changes (
src/matches/entities/match.entity.ts):
- Migration:
<timestamp>-AddScoreAndMultiplierToMatch.ts — adds the 3
- Indexer —
extractEventData() 'MatchAdded' case: add
- Indexer —
handleMatchAdded(): persist
- Indexer —
extractEventData() 'MatchResultSubmitted' case: add
- Indexer —
handleMatchResultSubmitted(): persist
ContractMatch interface (src/contract/contract.service.ts, lines
28-36): add homeScore: number | null, awayScore: number | null,
Acceptance Criteria
Background
`src/matches/entities/match.entity.
Goal
Add
home_score,away_score, andpoints_multipliertoMatch, write amigration, and update the indexer to capture and persist them.
Tasks
src/matches/entities/match.entity.ts):<timestamp>-AddScoreAndMultiplierToMatch.ts— adds the 3extractEventData()'MatchAdded'case: addhandleMatchAdded(): persistextractEventData()'MatchResultSubmitted'case: addhandleMatchResultSubmitted(): persistContractMatchinterface (src/contract/contract.service.ts, lines28-36): add
homeScore: number | null,awayScore: number | null,Acceptance Criteria
event_matchestable hashome_score,away_score(nullableMatchAddedevent withpoints_multiplier: 2persistsMatchAddedevent withpoints_multiplier: 5(out of range)MatchResultSubmittedevent withhome_score: 2, away_score: 1GET /matches/:id(matches.controller.ts) response includes