Skip to content

fix(be): client contest record authorization - #3718

Merged
lukekeum merged 4 commits into
mainfrom
t2906-client-contest-record-authorization
Aug 30, 2026
Merged

fix(be): client contest record authorization#3718
lukekeum merged 4 commits into
mainfrom
t2906-client-contest-record-authorization

Conversation

@mnseok

@mnseok mnseok commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Description

Endpoint 함수 참가 여부 판단 기준 Record 기반 여부 수정
POST /contest/:id/participation registerContest() ContestRecord로 이미 참가했는지 확인 UserContest의 role 검증 후 불러오는 방식으로 수정.
GET /contest/:id getContest() UserContest로 참가자/운영진 여부 계산 아니오  수정대상 x
DELETE /contest/:id/participation unregisterContest() UserContest와 ContestRecord를 함께 삭제 부분적 사용  수정대상 x
GET /contest/:id/leaderboard getContestLeaderboard() ContestRecord에서 참가자 점수·순위 조회 아니오. 통계 데이터  수정대상 x
GET /contest/:id/statistics/user/:userId getContestUserStatistics() 대상자의 ContestRecord 존재 여부 확인 아니오. 실제로 Record를 기반으로 통계 데이터를 만들기 때문에 검증 필요.  수정대상 x

Before submitting the PR, please make sure you do the following

Summary by CodeRabbit

  • Bug Fixes

    • Improved contest registration status checks for more accurate participant recognition.
    • Strengthened duplicate-registration validation to prevent incorrect registration results.
  • Style

    • Reformatted course Q&A data definitions for improved readability without changing functionality.

@mnseok mnseok self-assigned this Aug 30, 2026
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4ea5c531-9c4f-4791-9b0c-d3bbf7631d57

📥 Commits

Reviewing files that changed from the base of the PR and between d123c7f and 03b19b3.

📒 Files selected for processing (2)
  • apps/backend/apps/client/src/contest/contest.service.ts
  • apps/backend/prisma/schema.prisma

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Contest registration status and duplicate-registration checks now use participant-role userContest records. The CourseQnA Prisma model declarations were reformatted without schema changes.

Changes

Contest registration

Layer / File(s) Summary
Participant registration checks
apps/backend/apps/client/src/contest/contest.service.ts
getContests and registerContest now check participant-role userContest records instead of contest records.

Schema formatting

Layer / File(s) Summary
CourseQnA declaration formatting
apps/backend/prisma/schema.prisma
The CourseQnA field and relation declarations were reformatted. Their schema semantics remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 03b19

This change updates contest participation authorization behavior and related schema definitions; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the backend contest record authorization fix, which matches the main change in the pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t2906-client-contest-record-authorization

Comment @coderabbitai help to get the list of available commands.

@mnseok
mnseok requested review from dlwnsgk529 and lshtar13 August 30, 2026 09:28
@mnseok mnseok changed the title T2906 client contest record authorization fix(be): client contest record authorization Aug 30, 2026
@lukekeum lukekeum moved this to Approved 👌 in Codedang Aug 30, 2026
Comment thread apps/backend/prisma/schema.prisma Outdated
@github-project-automation github-project-automation Bot moved this from Approved 👌 to In Progress 🏃 in Codedang Aug 30, 2026
@github-project-automation github-project-automation Bot moved this from In Progress 🏃 to Approved 👌 in Codedang Aug 30, 2026
@lukekeum
lukekeum enabled auto-merge August 30, 2026 09:54
@lukekeum
lukekeum added this pull request to the merge queue Aug 30, 2026
Merged via the queue into main with commit d174f5d Aug 30, 2026
19 checks passed
@lukekeum
lukekeum deleted the t2906-client-contest-record-authorization branch August 30, 2026 09:59
@github-project-automation github-project-automation Bot moved this from Approved 👌 to Done ✔️ in Codedang Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done ✔️

Development

Successfully merging this pull request may close these issues.

2 participants