Skip to content

[Backend] — Extend CreatorEvent entity with campaign duration, prize pool, reward distribution, entry fee & branding #953

@Olowodarey

Description

@Olowodarey

Background

`src/matches/entities/creator-event.entity.

Goal

Add columns to CreatorEvent for the new campaign fields, write a migration,
and update the indexer's EventCreated handling to capture them from the
(updated) contract event payload.

Tasks

  1. Entity changes (src/matches/entities/creator-event.entity.ts):
  2. Migration: new file in src/migrations/, e.g.
  3. Indexer — extractEventData() 'EventCreated' case: add
  4. Indexer — handleEventCreated(): pass the new fields through to
    • start_time: new Date(Number(data.start_time) * 1000)
    • end_time: new Date(Number(data.end_time) * 1000)
    • prize_pool: this.readStr(data, 'prize_pool') || '0'
    • reward_distribution: (data.reward_distribution as number[]) ?? []

Acceptance Criteria

  • creator_events table has the 8 new columns + 2 new indexes after
  • EventCreated events that include the new fields populate all 8
  • EventCreated events that are missing the new fields (e.g. emitted by
  • Existing rows (pre-migration) get sensible backfilled

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