Skip to content

[feature] 지원서 제출 상태 변경 API 추가#621

Merged
lepitaaar merged 5 commits intofeature/remove-applicantfrom
feature/change-applicant-status
Aug 6, 2025
Merged

[feature] 지원서 제출 상태 변경 API 추가#621
lepitaaar merged 5 commits intofeature/remove-applicantfrom
feature/change-applicant-status

Conversation

@lepitaaar
Copy link
Contributor

@lepitaaar lepitaaar commented Aug 6, 2025

#️⃣연관된 이슈

#618

📝작업 내용

지원서 제출 상태 변경 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:13pm

@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

Walkthrough

클럽 지원자의 상세 정보를 수정할 수 있는 새로운 엔드포인트가 추가되었습니다. 이를 위해 컨트롤러, 서비스, 엔티티, DTO, 레포지토리, 에러코드 등 여러 계층에 메서드와 필드가 확장 및 추가되었습니다. 지원서 메모와 상태(status)를 수정할 수 있습니다.

Changes

Cohort / File(s) Change Summary
컨트롤러: 지원자 상세 수정 엔드포인트 추가
backend/src/main/java/moadong/club/controller/ClubApplyController.java
클럽 지원자 상세정보(메모, 상태) 수정용 PUT 엔드포인트(/api/club/{clubId}/apply/{appId}) 추가, 관련 의존성(import) 정리
엔티티: 지원서 메모 필드 및 수정 메서드 추가
backend/src/main/java/moadong/club/entity/ClubApplication.java
memo 필드 추가, updateDetail(String memo, ApplicationStatus status) 메서드 추가
DTO: 지원자 결과 필드 변경
backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java
필드명 questionIdid로 변경, createdAt 필드 추가, 정적 팩토리 메서드(of) 수정
DTO: 지원자 수정 요청 레코드 추가
backend/src/main/java/moadong/club/payload/request/ClubApplicantEditRequest.java
memo, status 필드를 갖는 신규 레코드 클래스 추가, memo에 유효성 검증 어노테이션 적용
레포지토리: 복합키 조회 메서드 추가
backend/src/main/java/moadong/club/repository/ClubApplicationRepository.java
findByIdAndQuestionId(String id, String questionId) 메서드 추가
서비스: 지원자 상세 수정 비즈니스 로직 추가
backend/src/main/java/moadong/club/service/ClubApplyService.java
editApplicantDetail 메서드 추가: 권한 및 존재 여부 검증, 지원서 메모/상태 수정, 예외 처리
글로벌 예외: 지원자 없음 에러코드 추가
backend/src/main/java/moadong/global/exception/ErrorCode.java
APPLICANT_NOT_FOUND 에러코드(900-2) 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller
    participant Service
    participant Repository
    participant Entity

    Client->>Controller: PUT /api/club/{clubId}/apply/{appId} (memo, status)
    Controller->>Service: editApplicantDetail(clubId, appId, request, user)
    Service->>Repository: find Club by clubId
    Service->>Repository: find ClubApplication by appId, clubId
    Service->>Entity: updateDetail(memo, status)
    Service->>Repository: save ClubApplication
    Service-->>Controller: 완료
    Controller-->>Client: 성공 응답 반환
Loading

Estimated code review effort

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

Possibly related issues

Possibly related PRs

Suggested reviewers

  • Zepelown
  • seongwon030

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ 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/change-applicant-status

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.

@lepitaaar lepitaaar changed the base branch from develop/be to feature/remove-applicant August 6, 2025 14:13
@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 c7a79d7.

@lepitaaar lepitaaar merged commit 4e73fd0 into feature/remove-applicant Aug 6, 2025
4 of 5 checks passed
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: 1

📜 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 c7a79d7.

📒 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 (4)
📓 Common learnings
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')는 로그인 기능 구현 후 동적으로 가져오는 방식으로 수정될 예정입니다.
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`와 같은 별도의 클래스를 정의하고 사용해야 합니다. 이렇게 하면 요청 객체 변경이 데이터베이스 스키마나 엔티티 계층에 영향을 미치지 않습니다.
📚 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/repository/ClubApplicationRepository.java
  • backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java
  • backend/src/main/java/moadong/club/controller/ClubApplyController.java
  • backend/src/main/java/moadong/club/service/ClubApplyService.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/payload/dto/ClubApplicantsResult.java
  • backend/src/main/java/moadong/club/service/ClubApplyService.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/controller/ClubApplyController.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (12)
backend/src/main/java/moadong/club/entity/ClubApplication.java (2)

33-34: LGTM!

memo 필드 추가가 적절하고, @Builder.Default를 사용한 기본값 설정도 좋습니다.


42-45: LGTM!

updateDetail 메서드 구현이 간결하고 명확합니다. 메서드명도 용도를 잘 나타내고 있습니다.

backend/src/main/java/moadong/club/repository/ClubApplicationRepository.java (2)

8-8: LGTM!

Optional import 추가가 적절합니다.


14-14: LGTM!

findByIdAndQuestionId 메서드가 Spring Data MongoDB 규칙을 잘 따르고 있고, 복합 조건 조회에 적합합니다.

backend/src/main/java/moadong/club/payload/request/ClubApplicantEditRequest.java (1)

7-13: LGTM!

Record 클래스 구조가 깔끔하고, memo 필드의 validation 설정이 적절합니다. @NotNull@Size(max = 500) 조합으로 적절한 제약사항을 설정했습니다.

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

22-22: LGTM!

createdAt 필드 추가로 더 풍부한 정보를 제공할 수 있게 되었습니다.


40-43: LGTM!

정적 팩토리 메서드의 변경사항이 새로운 필드 구조와 일치합니다.


19-19: API Breaking Change 주의: questionIdid 필드명 변경

내부 코드에서는 ClubApplicantsResult.of(...)에서 application.getId()를 사용하도록 모두 업데이트되어 있어 컴파일 오류는 없지만, 외부 API 클라이언트가 기존 questionId 필드에 의존하고 있다면 호환성이 깨질 수 있습니다.

영향 범위:

  • backend/src/main/java/moadong/club/payload/response/ClubApplyInfoResponse.java (응답 레코드에 List<ClubApplicantsResult> applicants 사용)
  • API 스펙(문서) 및 클라이언트 SDK/프론트엔드 요청/응답 정의

조치 제안:

  • API 문서와 OpenAPI 스펙에 필드명 변경을 반영
  • 필요한 경우 하위 호환성을 위한 questionId alias 추가 또는 버전 관리 고려
  • 클라이언트 팀에 변경 사항 릴리스 노트로 공지
backend/src/main/java/moadong/club/service/ClubApplyService.java (2)

3-3: 새로운 기능을 위한 필수 임포트가 적절히 추가되었습니다.

트랜잭션 처리와 새로운 요청 DTO를 위한 임포트가 올바르게 추가되었습니다.

Also applies to: 9-9


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

새로운 메서드는 다음과 같은 좋은 구조를 가지고 있습니다:

  • @Transactional 어노테이션으로 데이터 일관성 보장
  • 기존 패턴과 일치하는 권한 검증 로직
  • 적절한 예외 처리 및 에러 코드 사용
  • 엔티티의 updateDetail 메서드를 통한 캡슐화된 업데이트

메서드명이 "applicant detail"을 수정한다고 되어 있지만 실제로는 "application detail"을 수정하는 것 같습니다. 하지만 비즈니스 로직상 의미적으로 올바를 수 있으니 현재 구현으로도 충분합니다.

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

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

새 엔드포인트에 필요한 임포트가 올바르게 추가되었습니다.


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

새로운 PUT 엔드포인트는 다음과 같은 좋은 특징을 가지고 있습니다:

  • RESTful 설계 원칙에 따른 적절한 경로 구조 (/apply/{appId})
  • 기존 패턴과 일치하는 인증/인가 처리
  • @Validated 어노테이션을 통한 요청 유효성 검사
  • 명확한 Swagger 문서화
  • 서비스 레이어로의 적절한 위임
  • 일관된 응답 형식

구현이 기존 컨트롤러 패턴과 잘 일치하며 올바르게 작동할 것으로 보입니다.

Comment on lines +42 to +43
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

기존 에러코드와 메시지가 중복됩니다.

36번째 줄의 APPLICATION_NOT_FOUND와 새로운 APPLICANT_NOT_FOUND가 동일한 메시지 "지원서가 존재하지 않습니다."를 사용하고 있습니다. 두 에러코드의 용도가 다르다면 메시지를 구별하여 명확성을 높이는 것이 좋겠습니다.

예시:

-    APPLICANT_NOT_FOUND(HttpStatus.NOT_FOUND, "900-2", "지원서가 존재하지 않습니다."),
+    APPLICANT_NOT_FOUND(HttpStatus.NOT_FOUND, "900-2", "해당 지원자를 찾을 수 없습니다."),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
AES_CIPHER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "900-1", "암호화 중 오류가 발생했습니다."),
APPLICANT_NOT_FOUND(HttpStatus.NOT_FOUND, "900-2", "지원서가 존재하지 않습니다."),
AES_CIPHER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "900-1", "암호화 중 오류가 발생했습니다."),
APPLICANT_NOT_FOUND(HttpStatus.NOT_FOUND, "900-2", "해당 지원자를 찾을 수 없습니다."),
🤖 Prompt for AI Agents
In backend/src/main/java/moadong/global/exception/ErrorCode.java around lines 42
to 43, the error message for APPLICANT_NOT_FOUND duplicates the message used by
APPLICATION_NOT_FOUND on line 36. To improve clarity, update the
APPLICANT_NOT_FOUND message to be distinct and reflect its specific context,
ensuring each error code has a unique and clear message.

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.

1 participant

Comments