Skip to content

feat(social): bound challenge submission attempts (BA-057) - #1039

Open
ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-057-bound-challenge-attempts-970
Open

ranjeetprabhatedu-dotcom wants to merge 1 commit into
BlockDash-Studios:mainfrom
ranjeetprabhatedu-dotcom:feat/ba-057-bound-challenge-attempts-970

Conversation

@ranjeetprabhatedu-dotcom

Copy link
Copy Markdown

Summary

This PR addresses issue #970 (BA-057) by enforcing a bounded retry/attempt limit on challenge submissions with boundary test coverage before, at, and beyond the configured limit.

  • Changes:
    • BackendAcademy/src/social/dto/challenge.dto.ts: Added optional maxAttempts?: number configuration to CreateChallengeDto with @IsOptional(), @IsInt(), and @Min(1).
    • BackendAcademy/src/social/challenge.service.ts: Enforce attempt tracking and retry limits per user per challenge (defaulting to 3 attempts), rejecting excessive submissions with BadRequestException.
    • BackendAcademy/src/social/challenge.service.spec.ts: Added comprehensive unit tests asserting behavior before the limit, at the limit, beyond the limit, custom configured limits, and input validation.
  • Verification:
    • All 27 tests in challenge.service.spec.ts pass cleanly (100% Green).
    • Scope strictly restricted to the 3 allowlisted files.

Closes #970

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BA-057 — Bound challenge submission attempts

1 participant