Skip to content

[Backend] — Test: DisputesService.create allows second dispute after first is resolved #1107

Description

@Olowodarey

Background

DisputesService.create checks for an existing dispute with
status: DisputeStatus.PENDING. If a previous dispute was resolved (status
changed to RESOLVED or REJECTED), a second dispute can be raised for the
same market. It's unclear if this is intentional. There are no tests for this
scenario.

Goal

Add tests clarifying the intended behavior and guard it.

Requirements

  1. Determine the intended behavior by checking business rules: can a market
    receive only one dispute ever, or one active dispute at a time?

    • If one per market ever: change the check to where: { marketId } (no
      status filter).
    • If one active at a time: the current check is correct.
  2. Regardless of the decision, add tests in

Acceptance criteria

  • Policy is documented and tested.
  • No silent second-dispute creation that contradicts the policy.

Metadata

Metadata

Assignees

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