Skip to content

[Backend] — Market Settlement State Machine Validation #1616

Description

@Olowodarey

Problem
markets settlement transitions aren't guarded, so a market can move to an invalid settlement state.

Requirements

  • Enforce allowed settlement transitions (open → closed → resolving → settled/cancelled).
  • Reject illegal transitions with a descriptive error.
  • Tests: each valid transition allowed; illegal ones rejected.

Acceptance Criteria

  • Market settlement follows a validated lifecycle. Covered by tests.

Files

  • backend/src/markets/markets.service.ts
  • backend/src/markets/entities
  • backend/src/migrations/1776700000000-AddMarketSettlementState.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions