Skip to content

[feautre] 지원서 관리 API#622

Merged
lepitaaar merged 8 commits intodevelop/befrom
feature/remove-applicant
Aug 9, 2025
Merged

[feautre] 지원서 관리 API#622
lepitaaar merged 8 commits intodevelop/befrom
feature/remove-applicant

Conversation

@lepitaaar
Copy link
Contributor

@lepitaaar lepitaaar commented Aug 6, 2025

#️⃣연관된 이슈

#619, #618, #617

📝작업 내용

  • 지원서 메모 API
  • 지원서 상태 API
  • 지원서 삭제 API

중점적으로 리뷰받고 싶은 부분(선택)

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

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

  • 신규 기능

    • 동아리 지원자 개별 정보(메모, 상태)를 수정할 수 있는 기능이 추가되었습니다.
    • 동아리 지원자 개별 지원서를 삭제할 수 있는 기능이 추가되었습니다.
  • 버그 수정

    • 지원서가 존재하지 않을 때의 오류 메시지가 개선되었습니다.
  • 기타

    • 지원자 정보에 메모 및 생성일 표시가 추가되었습니다.

@lepitaaar lepitaaar self-assigned this Aug 6, 2025
@lepitaaar lepitaaar added ✨ Feature 기능 개발 📬 API 서버 API 통신 작업 💾 BE Backend labels Aug 6, 2025
@vercel
Copy link

vercel bot commented Aug 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
moadong ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2025 2:29pm

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

최고입니다..

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

Test Results

75 tests   75 ✅  2s ⏱️
12 suites   0 💤
12 files     0 ❌

Results for commit b2de6c7.

♻️ This comment has been updated with latest results.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • 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

Warning

Rate limit exceeded

@lepitaaar has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 56 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 596a0e4 and b2de6c7.

📒 Files selected for processing (1)
  • backend/src/main/java/moadong/club/payload/request/ClubApplicantEditRequest.java (1 hunks)

Walkthrough

개별 동아리 지원자 관리 기능이 확장되었습니다. 지원자 상세 정보를 수정하는 PUT 엔드포인트와 지원자 삭제를 위한 DELETE 엔드포인트가 추가되었습니다. 지원서 엔티티에 메모 필드와 수정 메서드가 도입되었고, 관련 DTO, 레포지토리, 서비스, 에러코드가 함께 보완되었습니다.

Changes

Cohort / File(s) Change Summary
컨트롤러 및 엔드포인트 확장
backend/src/main/java/moadong/club/controller/ClubApplyController.java
지원자 상세 수정(메모, 상태)용 PUT, 지원자 삭제용 DELETE 엔드포인트 추가. 인증 필요.
엔티티 확장
backend/src/main/java/moadong/club/entity/ClubApplication.java
memo 필드 추가, 메모 및 상태 동시 수정 메서드(updateDetail) 추가.
지원자 결과 DTO 변경
backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java
필드명 questionIdid로 변경, createdAt 필드 추가, 팩토리 메서드 수정.
지원자 수정 요청 DTO 추가
backend/src/main/java/moadong/club/payload/request/ClubApplicantEditRequest.java
메모(최대 500자, not null), 상태를 포함하는 신규 레코드 클래스 추가.
레포지토리 메서드 추가
backend/src/main/java/moadong/club/repository/ClubApplicationRepository.java
findByIdAndQuestionId 메서드 추가로 지원서 단건 조회 가능.
서비스 로직 확장
backend/src/main/java/moadong/club/service/ClubApplyService.java
지원자 상세 수정 및 삭제 트랜잭션 메서드 추가, 권한 및 존재 여부 검증 포함.
에러코드 추가
backend/src/main/java/moadong/global/exception/ErrorCode.java
지원서 미존재시 에러코드(APPLICANT_NOT_FOUND) 추가.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller
    participant Service
    participant Repository
    participant Entity

    Client->>Controller: PUT /api/club/{clubId}/apply/{appId} (수정 요청)
    Controller->>Service: editApplicantDetail(clubId, appId, request, user)
    Service->>Repository: findByIdAndQuestionId(appId, clubId)
    Repository-->>Service: ClubApplication
    Service->>Entity: updateDetail(memo, status)
    Service->>Repository: save(ClubApplication)
    Service-->>Controller: 완료
    Controller-->>Client: 성공 응답

    Client->>Controller: DELETE /api/club/{clubId}/apply/{appId} (삭제 요청)
    Controller->>Service: deleteApplicant(clubId, appId, user)
    Service->>Repository: findByIdAndQuestionId(appId, clubId)
    Repository-->>Service: ClubApplication
    Service->>Repository: delete(ClubApplication)
    Service-->>Controller: 완료
    Controller-->>Client: 성공 응답
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

Suggested reviewers

  • Zepelown
  • seongwon030
  • oesnuj
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/remove-applicant

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.

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
backend/src/main/java/moadong/club/entity/ClubApplication.java (1)

42-45: 엔티티 변경 메서드 검토 필요

updateDetail 메서드가 필드를 직접 변경하는 방식으로 구현되었습니다. 다음 사항들을 고려해보세요:

  1. 입력값에 대한 검증 로직 추가 (memo 길이 제한 등)
  2. 변경 추적을 위한 lastModifiedAt 필드 업데이트
  3. 도메인 이벤트 발행 고려
 public void updateDetail(String memo, ApplicationStatus status) {
+    if (memo != null && memo.length() > 500) {
+        throw new IllegalArgumentException("메모는 500자를 초과할 수 없습니다.");
+    }
     this.memo = memo;
     this.status = status;
+    // lastModifiedAt 필드가 있다면 업데이트
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2ff5a8d and 596a0e4.

📒 Files selected for processing (7)
  • backend/src/main/java/moadong/club/controller/ClubApplyController.java (2 hunks)
  • backend/src/main/java/moadong/club/entity/ClubApplication.java (1 hunks)
  • backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java (2 hunks)
  • backend/src/main/java/moadong/club/payload/request/ClubApplicantEditRequest.java (1 hunks)
  • backend/src/main/java/moadong/club/repository/ClubApplicationRepository.java (1 hunks)
  • backend/src/main/java/moadong/club/service/ClubApplyService.java (2 hunks)
  • backend/src/main/java/moadong/global/exception/ErrorCode.java (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: the code duplication between createclubapplication and editclubapplication methods in clubapplyservi...
Learnt from: lepitaaar
PR: Moadong/moadong#406
File: backend/src/main/java/moadong/club/service/ClubApplyService.java:34-38
Timestamp: 2025-05-19T05:45:52.957Z
Learning: The code duplication between createClubApplication and editClubApplication methods in ClubApplyService.java is acknowledged but will be addressed in a future refactoring, as per the developer's plan.

Applied to files:

  • backend/src/main/java/moadong/club/entity/ClubApplication.java
  • backend/src/main/java/moadong/club/payload/request/ClubApplicantEditRequest.java
  • backend/src/main/java/moadong/club/service/ClubApplyService.java
  • backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java
  • backend/src/main/java/moadong/club/repository/ClubApplicationRepository.java
  • backend/src/main/java/moadong/club/controller/ClubApplyController.java
📚 Learning: 엔티티 클래스는 요청/응답 객체(dto)에 의존해서는 안 됩니다. 계층 간 의존성 문제를 방지하기 위해 엔티티와 dto는 분리되어야 합니다. 예를 들어, `clubapplicati...
Learnt from: Zepelown
PR: Moadong/moadong#406
File: backend/src/main/java/moadong/club/entity/ClubApplicationQuestion.java:32-33
Timestamp: 2025-05-15T12:03:57.356Z
Learning: 엔티티 클래스는 요청/응답 객체(DTO)에 의존해서는 안 됩니다. 계층 간 의존성 문제를 방지하기 위해 엔티티와 DTO는 분리되어야 합니다. 예를 들어, `ClubApplicationQuestion` 엔티티가 `ClubApplicationRequest.Options`와 같은 요청 객체를 직접 참조하는 대신, 엔티티 패키지 내에 `QuestionOptions`와 같은 별도의 클래스를 정의하고 사용해야 합니다. 이렇게 하면 요청 객체 변경이 데이터베이스 스키마나 엔티티 계층에 영향을 미치지 않습니다.

Applied to files:

  • backend/src/main/java/moadong/club/service/ClubApplyService.java
  • backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java
📚 Learning: adminpage.tsx에서 현재 하드코딩된 클럽 id('67d2e3b9b15c136c6acbf20b')는 로그인 기능 구현 후 동적으로 가져오는 방식으로 수정될 예정입니다....
Learnt from: seongwon030
PR: Moadong/moadong#195
File: frontend/src/pages/AdminPage/AdminPage.tsx:7-7
Timestamp: 2025-03-19T05:18:07.818Z
Learning: AdminPage.tsx에서 현재 하드코딩된 클럽 ID('67d2e3b9b15c136c6acbf20b')는 로그인 기능 구현 후 동적으로 가져오는 방식으로 수정될 예정입니다.

Applied to files:

  • backend/src/main/java/moadong/club/service/ClubApplyService.java
🔇 Additional comments (11)
backend/src/main/java/moadong/club/repository/ClubApplicationRepository.java (1)

14-14: LGTM!

새로운 findByIdAndQuestionId 메서드가 적절하게 추가되었습니다. id와 questionId를 모두 조건으로 사용하는 것은 권한 검증 측면에서도 좋은 설계입니다.

backend/src/main/java/moadong/club/entity/ClubApplication.java (1)

33-34: LGTM!

memo 필드가 적절하게 추가되었습니다. 기본값 설정과 Builder.Default 사용도 적절합니다.

backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java (3)

19-19: 필드명 변경에 따른 breaking change 검토

questionId 필드가 id로 변경되었습니다. 이는 기존 API 응답 구조를 변경하므로 클라이언트에 breaking change를 일으킬 수 있습니다.

기존 API를 사용하는 클라이언트가 있는지 확인하고, 필요시 버전 관리나 마이그레이션 계획을 수립해주세요.


22-22: LGTM!

createdAt 필드 추가로 지원서 생성 시간 정보를 제공하는 것은 좋은 개선입니다.


40-43: LGTM!

factory 메서드에서 새로운 필드들이 적절하게 매핑되었습니다. 기존 암호화 해독 로직도 유지되어 좋습니다.

backend/src/main/java/moadong/club/service/ClubApplyService.java (3)

3-3: 새로운 임포트가 적절히 추가되었습니다.

@Transactional 어노테이션과 ClubApplicantEditRequest DTO에 대한 임포트가 새로운 기능에 맞게 올바르게 추가되었습니다.

Also applies to: 9-9


128-143: 지원자 상세 정보 수정 로직이 올바르게 구현되었습니다.

메서드가 다음과 같은 올바른 패턴을 따르고 있습니다:

  • 클럽 존재 여부 및 권한 확인
  • 지원서 조회 및 존재 여부 확인
  • 엔티티 업데이트 및 저장
  • @Transactional 어노테이션으로 데이터 일관성 보장

기존 코드와 일관된 구조와 예외 처리를 사용하고 있습니다.


145-159: 지원자 삭제 로직이 올바르게 구현되었습니다.

삭제 메서드가 다음과 같은 안전한 패턴을 따르고 있습니다:

  • 동일한 권한 확인 로직 사용
  • 삭제 전 지원서 존재 여부 확인
  • @Transactional 어노테이션으로 원자성 보장

코드 구조가 기존 서비스 메서드들과 일관되며 적절한 예외 처리를 포함하고 있습니다.

backend/src/main/java/moadong/club/controller/ClubApplyController.java (3)

7-7: 새로운 DTO 임포트가 적절히 추가되었습니다.

ClubApplicantEditRequest가 새로운 엔드포인트에서 사용되기 위해 올바르게 임포트되었습니다.


73-86: 지원자 정보 수정 엔드포인트가 올바르게 구현되었습니다.

다음과 같은 좋은 관행들이 적용되었습니다:

  • RESTful 경로 설계 (/apply/{appId})
  • 적절한 HTTP 메서드 (PUT) 사용
  • 인증 및 권한 검증
  • 요청 본문 유효성 검사
  • 명확한 Swagger 문서화

기존 엔드포인트들과 일관된 구조를 따르고 있습니다.


88-101: 지원자 삭제 엔드포인트가 올바르게 구현되었습니다.

다음과 같은 올바른 패턴들이 적용되었습니다:

  • 적절한 HTTP 메서드 (DELETE) 사용
  • 동일한 경로 패턴으로 일관성 유지
  • 보안 어노테이션과 인증 요구사항
  • 명확한 API 문서화

메서드명 removeApplicantdeleteApplicant 서비스 메서드와 일치하지 않지만, 컨트롤러 레벨에서는 의미상 적절합니다.


AES_CIPHER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "900-1", "암호화 중 오류가 발생했습니다.")
AES_CIPHER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "900-1", "암호화 중 오류가 발생했습니다."),
APPLICANT_NOT_FOUND(HttpStatus.NOT_FOUND, "900-2", "지원서가 존재하지 않습니다."),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

중복 에러 코드 검토 필요

APPLICANT_NOT_FOUND와 기존 APPLICATION_NOT_FOUND (Line 36) 사이에 기능적 중복이 있어 보입니다. 두 에러 코드 모두 같은 메시지("지원서가 존재하지 않습니다.")를 가지고 있습니다.

새로운 지원자 관리 API에서 기존 APPLICATION_NOT_FOUND를 재사용할 수 있는지 검토하거나, 두 에러 코드 간의 구체적인 차이점을 명확히 해주세요.

🤖 Prompt for AI Agents
In backend/src/main/java/moadong/global/exception/ErrorCode.java at line 43,
there is a potential functional overlap between APPLICANT_NOT_FOUND and
APPLICATION_NOT_FOUND at line 36, both having the same error message. Review
whether the existing APPLICATION_NOT_FOUND error code can be reused for the new
applicant management API instead of creating APPLICANT_NOT_FOUND. If both are
necessary, clarify and differentiate their specific use cases and error messages
to avoid confusion and redundancy.

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

Labels

📬 API 서버 API 통신 작업 💾 BE Backend ✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments