Skip to content

[Backend] — Extend Match entity with final scoreline & bonus points multiplier #954

@Olowodarey

Description

@Olowodarey

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

  1. Entity changes (src/matches/entities/match.entity.ts):
  2. Migration: <timestamp>-AddScoreAndMultiplierToMatch.ts — adds the 3
  3. Indexer — extractEventData() 'MatchAdded' case: add
  4. Indexer — handleMatchAdded(): persist
  5. Indexer — extractEventData() 'MatchResultSubmitted' case: add
  6. Indexer — handleMatchResultSubmitted(): persist
  7. ContractMatch interface (src/contract/contract.service.ts, lines
    28-36): add homeScore: number | null, awayScore: number | null,

Acceptance Criteria

  • event_matches table has home_score, away_score (nullable
  • A MatchAdded event with points_multiplier: 2 persists
  • A MatchAdded event with points_multiplier: 5 (out of range)
  • A MatchResultSubmitted event with home_score: 2, away_score: 1
  • GET /matches/:id (matches.controller.ts) response includes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions