Skip to content

[Backend] — Test: FlagsService.createFlag allows re-flagging after a flag is resolved #1159

Description

@Olowodarey

Background

FlagsService.createFlag (src/flags/flags.service.ts) only rejects duplicate
flags when status: FlagStatus.PENDING. Once a flag is resolved or dismissed,
the user should be allowed to raise a new flag. There are no tests confirming
this re-flagging behavior or verifying the duplicate check is limited to pending
status.

Goal

Add tests in src/flags/flags.service.spec.ts (create if absent).

Requirements

  1. Pending duplicate: flag exists with status = PENDINGConflictException.
  2. Resolved duplicate allowed: flag exists with status = RESOLVED → new
    flag created successfully.
  3. Dismissed duplicate allowed: flag exists with status = DISMISSED → new
    flag created.
  4. No existing flag: first flag on market → created.

Acceptance criteria

  • Only PENDING duplicate is blocked.
  • Post-resolution re-flagging allowed.

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