Skip to content

Feat/challenge participation#229

Merged
jihwankim128 merged 5 commits intomainfrom
feat/challenge-participation
Aug 11, 2025
Merged

Feat/challenge participation#229
jihwankim128 merged 5 commits intomainfrom
feat/challenge-participation

Conversation

@jihwankim128
Copy link
Collaborator

@jihwankim128 jihwankim128 commented Aug 11, 2025

#️⃣ 연관된 이슈

ex) close #Issue number

📝 작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

📷 스크린샷

이미지

💬 리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 명칭

📌 PR 진행 시 참고사항

  • 리뷰어는 좋은 코드 방향을 제시하되, 수정을 강요하지 않습니다.
  • 좋은 코드를 발견하면 칭찬과 격려를 아끼지 않습니다.
  • 리뷰는 Reviewer로 지정된 시점 기준으로 3일 이내에 진행해 주세요.
  • Comment 작성 시 아래 Prefix를 사용해 주세요:
    • P1: 꼭 반영해 주세요 (Request Changes) – 이슈나 취약점 관련
    • P2: 반영을 고려해 주세요 (Comment) – 개선 의견
    • P3: 단순 제안 (Chore)

Summary by CodeRabbit

  • New Features
    • Admin: View challenge participants with pagination for team groups and personal challenges.
    • Admin: Download participant lists to Excel for team groups and personal challenges.
  • Documentation
    • Added API docs for new participant listing and Excel export endpoints.
    • Renamed personal challenge Excel export endpoint for clarity.
  • Chores
    • Removed deprecated team challenge participants endpoint.
    • Internal utilities added for member key enrichment and Excel mapping (no user-visible behavior change).

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds admin participant listing and Excel export endpoints for personal and team challenges; introduces DTOs, converters, and Excel mappers; refactors personal challenge queries via an executor/predicate pattern; implements participant queries for challenge groups; adds memberKey resolution utilities; updates repositories; and makes minor controller and entity adjustments.

Changes

Cohort / File(s) Summary
Admin Team Participant Endpoints
.../controller/query/AdminChallengeGroupQueryController.java, .../controller/query/docs/AdminChallengeGroupQueryControllerDocs.java, .../controller/query/AdminTeamChallengeQueryController.java, .../controller/query/docs/AdminTeamChallengeQueryControllerDocs.java
Added GET participants and participants/excel endpoints and docs for challenge groups; removed deprecated team participants endpoint and docs in AdminTeamChallenge controllers.
Admin Personal Participant Endpoints
.../controller/query/AdminPersonalChallengeQueryController.java, .../controller/query/docs/AdminPersonalChallengeQueryControllerDocs.java
Added GET participants and participants/excel endpoints and docs for personal challenges; renamed existing challenge Excel download method.
ChallengeGroup Participant Queries
.../infra/querydsl/ChallengeGroupQueryImpl.java, .../repository/query/ChallengeGroupQuery.java
Implemented paginated and Excel participant queries for team challenge groups; added count helper; updated admin group detail mapping.
Personal Query Refactor & Participants
.../infra/querydsl/PersonalChallengeQueryImpl.java, .../infra/querydsl/executor/PersonalChallengeQueryExecutor.java, .../infra/querydsl/predicates/PersonalChallengePredicates.java, .../infra/querydsl/projections/PersonalChallengeProjections.java, .../repository/query/PersonalChallengeQuery.java, .../repository/PersonalChallengeRepository.java
Refactored to executor/predicate-based queries; added admin participant queries (paginated and Excel); added projections and repository method to count participants.
Participant DTOs & Interface
.../controller/query/dto/MemberKeySettable.java, .../controller/query/dto/challenge/AdminPersonalParticipationDto.java, .../controller/query/dto/challenge/AdminTeamParticipantDto.java, .../controller/query/dto/challenge/AdminChallengeParticipantListResponseDto.java
Introduced MemberKeySettable interface and new AdminPersonalParticipationDto/AdminTeamParticipantDto; removed obsolete AdminChallengeParticipantListResponseDto.
Excel Mappers
.../infra/PersonalParticipantExcelMapper.java, .../infra/TeamParticipantExcelMapper.java
Added Excel mappers for personal and team participant exports with headers and row extraction.
Member Key Utilities
.../util/MemberKeyConverter.java, .../util/ClientHelper.java, .../global/client/MemberClient.java, .../infra/adapter/MemberAdapter.java
Added batch ID→memberKey resolution and converter for DTOs/pages; exposed member client/map APIs.
Entities & Participation
.../entity/challenge/BaseChallengeParticipation.java, .../entity/challenge/PersonalChallengeParticipation.java, .../entity/challenge/TeamChallengeParticipation.java, .../entity/challenge/BaseChallenge.java
Added memberId and certCount to base participation; minor param/name/comment tweaks in personal/team participation and base challenge.
Misc Controllers & Imports
.../controller/command/ChallengeGroupCommandController.java, .../controller/command/PersonalChallengeCommandController.java, .../controller/command/TeamChallengeCommandController.java, .../controller/query/ChallengeGroupQueryController.java, .../controller/query/PersonalChallengeQueryController.java, .../controller/query/TeamChallengeQueryController.java, .../infra/querydsl/TeamChallengeQueryImpl.java, .../repository/query/TeamChallengeQuery.java
Added TODO comments and a memberId change (team join: 1L→2L); minor import/order adjustments; no functional query/interface changes.

Sequence Diagram(s)

sequenceDiagram
  participant Admin as Admin Client
  participant C as Controller (AdminChallengeGroupQueryController)
  participant Q as ChallengeGroupQuery
  participant Conv as MemberKeyConverter
  participant Excel as ExcelDownloader

  Admin->>C: GET /{challengeId}/groups/participants?page&size
  C->>Q: findParticipantByChallenge(challengeId, page, size)
  Q-->>C: Page<AdminTeamParticipantDto> (memberId populated)
  C->>Conv: convertPage(page)
  Conv-->>C: page with memberKey set
  C-->>Admin: ApiTemplate<PageTemplate<...>>

  Admin->>C: GET /{challengeId}/groups/participants/excel
  C->>Q: findParticipantByChallengeForExcel(challengeId)
  Q-->>C: List<AdminTeamParticipantDto> (memberId populated)
  C->>Conv: convert(list)
  Conv-->>C: list with memberKey set
  C->>Excel: downloadAsStream(list, response)
  Excel-->>Admin: Excel stream
Loading
sequenceDiagram
  participant Admin as Admin Client
  participant PC as AdminPersonalChallengeQueryController
  participant PQ as PersonalChallengeQueryImpl
  participant Exec as PersonalChallengeQueryExecutor
  participant Conv as MemberKeyConverter
  participant Excel as ExcelDownloader

  Admin->>PC: GET /{challengeId}/participants
  PC->>PQ: findParticipantByChallenge(challengeId, page, size)
  PQ->>Exec: executeParticipantQueryForAdmin(pagination, challengeId)
  Exec-->>PQ: List<AdminPersonalParticipationDto>
  PQ-->>PC: PageTemplate<...>
  PC->>Conv: convertPage(page)
  Conv-->>PC: page with memberKey
  PC-->>Admin: ApiTemplate<PageTemplate<...>>

  Admin->>PC: GET /{challengeId}/participants/excel
  PC->>PQ: findParticipantByChallengeForExcel(challengeId)
  PQ->>Exec: executeParticipantQueryForExcel(challengeId)
  Exec-->>PQ: List<AdminPersonalParticipationDto>
  PQ-->>PC: list
  PC->>Conv: convert(list)
  Conv-->>PC: list with memberKey
  PC->>Excel: downloadAsStream(list, response)
  Excel-->>Admin: Excel stream
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40–55 minutes

Possibly related PRs

Suggested labels

dev:feature

Poem

A whisker twitch, new routes appear,
I hop through pages, far and near.
Keys for members, rows in line,
Excel streams like carrot wine.
Queries pruned, projections grow—
Thump-thump! Admins, off we go! 🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ca3c8e and fad6a9c.

📒 Files selected for processing (37)
  • src/main/java/com/example/green/domain/challenge/controller/command/ChallengeGroupCommandController.java (2 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/command/PersonalChallengeCommandController.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/command/TeamChallengeCommandController.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/AdminChallengeGroupQueryController.java (4 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/AdminPersonalChallengeQueryController.java (3 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/AdminTeamChallengeQueryController.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/ChallengeGroupQueryController.java (2 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/PersonalChallengeQueryController.java (3 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/TeamChallengeQueryController.java (3 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/docs/AdminChallengeGroupQueryControllerDocs.java (3 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/docs/AdminPersonalChallengeQueryControllerDocs.java (3 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/docs/AdminTeamChallengeQueryControllerDocs.java (0 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/dto/MemberKeySettable.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/dto/challenge/AdminChallengeParticipantListResponseDto.java (0 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/dto/challenge/AdminPersonalParticipationDto.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/controller/query/dto/challenge/AdminTeamParticipantDto.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/entity/challenge/BaseChallenge.java (0 hunks)
  • src/main/java/com/example/green/domain/challenge/entity/challenge/BaseChallengeParticipation.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/entity/challenge/PersonalChallengeParticipation.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/entity/challenge/TeamChallengeParticipation.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/infra/PersonalParticipantExcelMapper.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/infra/TeamParticipantExcelMapper.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/infra/querydsl/ChallengeGroupQueryImpl.java (2 hunks)
  • src/main/java/com/example/green/domain/challenge/infra/querydsl/PersonalChallengeQueryImpl.java (4 hunks)
  • src/main/java/com/example/green/domain/challenge/infra/querydsl/TeamChallengeQueryImpl.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/infra/querydsl/executor/PersonalChallengeQueryExecutor.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/infra/querydsl/predicates/PersonalChallengePredicates.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/infra/querydsl/projections/PersonalChallengeProjections.java (2 hunks)
  • src/main/java/com/example/green/domain/challenge/infra/querydsl/projections/TeamChallengeProjections.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/repository/PersonalChallengeRepository.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/repository/query/ChallengeGroupQuery.java (2 hunks)
  • src/main/java/com/example/green/domain/challenge/repository/query/PersonalChallengeQuery.java (2 hunks)
  • src/main/java/com/example/green/domain/challenge/repository/query/TeamChallengeQuery.java (1 hunks)
  • src/main/java/com/example/green/domain/challenge/util/ClientHelper.java (2 hunks)
  • src/main/java/com/example/green/domain/challenge/util/MemberKeyConverter.java (1 hunks)
  • src/main/java/com/example/green/global/client/MemberClient.java (2 hunks)
  • src/main/java/com/example/green/infra/adapter/MemberAdapter.java (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/challenge-participation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jihwankim128 jihwankim128 merged commit e7b23f6 into main Aug 11, 2025
1 of 2 checks passed
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.

1 participant