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
- Pending duplicate: flag exists with
status = PENDING → ConflictException.
- Resolved duplicate allowed: flag exists with
status = RESOLVED → new
flag created successfully.
- Dismissed duplicate allowed: flag exists with
status = DISMISSED → new
flag created.
- No existing flag: first flag on market → created.
Acceptance criteria
- Only PENDING duplicate is blocked.
- Post-resolution re-flagging allowed.
Background
FlagsService.createFlag(src/flags/flags.service.ts) only rejects duplicateflags 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
status = PENDING→ConflictException.status = RESOLVED→ newflag created successfully.
status = DISMISSED→ newflag created.
Acceptance criteria