Skip to content

[feature] 지원서의 메모를 수정할 수 있다.#620

Merged
lepitaaar merged 3 commits intofeature/change-applicant-statusfrom
feature/applicant-detail-edit
Aug 6, 2025
Merged

[feature] 지원서의 메모를 수정할 수 있다.#620
lepitaaar merged 3 commits intofeature/change-applicant-statusfrom
feature/applicant-detail-edit

Conversation

@lepitaaar
Copy link
Contributor

@lepitaaar lepitaaar commented Aug 6, 2025

#️⃣연관된 이슈

#617

📝작업 내용

지원자 응답 날짜 추가
지원자 메모 필드 추가
지원자 메모 필드 수정

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

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

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

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

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

🫡 참고사항

Summary by CodeRabbit

  • 신규 기능

    • 동아리 지원자의 메모를 수정할 수 있는 API가 추가되었습니다.
    • 지원자 메모 입력 시 최대 500자까지 작성할 수 있습니다.
  • 버그 수정

    • 지원서가 존재하지 않을 때 적절한 오류 메시지가 반환됩니다.
  • 기타

    • 지원자 목록 조회 시 생성일 정보가 추가로 제공됩니다.

@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:01pm

@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

클럽 지원자의 메모를 수정할 수 있는 기능이 추가되었습니다. 이를 위해 컨트롤러에 PUT 엔드포인트가 신설되고, 서비스, 엔티티, DTO, 예외 코드, 레포지토리 등 관련 코드가 일괄적으로 확장 및 수정되었습니다.

Changes

Cohort / File(s) Change Summary
컨트롤러 및 엔드포인트 추가
backend/src/main/java/moadong/club/controller/ClubApplyController.java
클럽 지원자 메모 수정을 위한 PUT /api/club/{clubId}/apply/{appId} 엔드포인트 추가 및 관련 의존성 정리
엔티티 확장
backend/src/main/java/moadong/club/entity/ClubApplication.java
memo 필드 및 메모 갱신용 updateDetail(String memo) 메서드 추가
DTO 및 반환값 변경
backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java
필드명 questionIdid로 변경, createdAt 필드 추가, 팩토리 메서드 수정
요청 DTO 추가
backend/src/main/java/moadong/club/payload/request/ClubApplicantEditRequest.java
메모 수정을 위한 memo 필드(최대 500자, NotNull) 단일 레코드 DTO 신설
레포지토리 확장
backend/src/main/java/moadong/club/repository/ClubApplicationRepository.java
findByIdAndQuestionId 메서드 추가로 복합조건 지원
서비스 로직 추가
backend/src/main/java/moadong/club/service/ClubApplyService.java
지원자 메모 수정 비즈니스 로직(editApplicantDetail) 추가, 권한 및 예외 처리 포함
글로벌 예외 코드 추가
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} (memo)
    Controller->>Service: editApplicantDetail(clubId, appId, request, user)
    Service->>Repository: findByIdAndQuestionId(appId, clubId)
    Repository-->>Service: ClubApplication or not found
    Service->>Entity: updateDetail(memo)
    Service->>Repository: save(application)
    Service-->>Controller: 완료
    Controller-->>Client: 성공 응답
Loading

Estimated code review effort

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

Possibly related issues

Suggested reviewers

  • seongwon030
  • Zepelown

Note

⚡️ Unit Test Generation is now available in beta!

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


📜 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 2ff5a8d and c4f8aa4.

📒 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`와 같은 별도의 클래스를 정의하고 사용해야 합니다. 이렇게 하면 요청 객체 변경이 데이터베이스 스키마나 엔티티 계층에 영향을 미치지 않습니다.
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.
📚 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/service/ClubApplyService.java
  • backend/src/main/java/moadong/club/repository/ClubApplicationRepository.java
  • backend/src/main/java/moadong/club/entity/ClubApplication.java
  • backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java
  • backend/src/main/java/moadong/club/payload/request/ClubApplicantEditRequest.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/controller/ClubApplyController.java
🔇 Additional comments (15)
backend/src/main/java/moadong/club/entity/ClubApplication.java (2)

33-34: 메모 필드 추가가 적절합니다.

기본값으로 빈 문자열을 설정하고 @Builder.Default 어노테이션을 사용한 것이 좋습니다. 기존 데이터와의 호환성을 보장합니다.


42-44: 메모 업데이트 메서드 구현이 올바릅니다.

단일 필드 업데이트를 위한 간단하고 명확한 메서드입니다. 엔캡슐레이션 원칙을 잘 따르고 있습니다.

backend/src/main/java/moadong/global/exception/ErrorCode.java (1)

42-43: 에러 코드 추가가 적절합니다.

새로운 APPLICANT_NOT_FOUND 에러 코드가 기존 패턴을 일관되게 따르고 있습니다. HTTP 상태, 코드 번호, 메시지가 모두 적절하게 설정되었습니다.

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

8-8: Optional 임포트 추가가 적절합니다.

새로운 메서드의 반환 타입을 위해 필요한 임포트입니다.


14-14: 레포지토리 메서드 추가가 올바릅니다.

Spring Data JPA 네이밍 컨벤션을 따르고 있으며, Optional<ClubApplication> 반환 타입으로 존재하지 않을 수 있는 엔티티를 안전하게 처리합니다.

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

6-11: 요청 DTO 구현이 적절합니다.

레코드 클래스 사용과 유효성 검증 어노테이션이 올바르게 적용되었습니다. 메모 길이 제한(500자)도 합리적입니다.

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

3-3: 트랜잭션 임포트 추가가 적절합니다.

새로운 데이터 수정 메서드를 위해 필요한 임포트입니다.


9-9: 요청 DTO 임포트 추가가 적절합니다.

새로운 메서드에서 사용할 요청 객체 임포트입니다.


128-143: 지원자 상세 정보 수정 메서드 구현이 우수합니다.

메서드가 보안과 에러 처리를 적절하게 구현했습니다:

  • 클럽 소유자 권한 확인
  • 지원서 존재 여부 검증
  • 적절한 에러 코드 사용
  • @Transactional 어노테이션으로 데이터 일관성 보장
backend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.java (4)

12-12: LocalDateTime 임포트 추가 승인

새로 추가된 createdAt 필드를 위해 필요한 임포트입니다.


22-22: createdAt 필드 추가 승인

지원서 생성 시각을 추적하기 위한 필드 추가가 적절합니다.


40-40: factory method 업데이트 승인

  • application.getId()로 변경하여 더 정확한 데이터를 매핑하고 있습니다.
  • application.getCreatedAt() 추가로 새로운 필드를 적절히 설정하고 있습니다.

Also applies to: 43-43


19-19: ClubApplicantsResult DTO의 questionIdid 필드명 변경 영향 없음 확인
rg 검색 결과, 해당 DTO를 참조하는 코드(매핑 로직 및 응답 객체 생성)에서는 기존 questionId 필드를 사용한 부분이 없으므로 추가 수정이 필요하지 않습니다.

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

7-7: 새로운 DTO 임포트 추가 승인

ClubApplicantEditRequest 임포트가 새로운 엔드포인트에서 적절히 사용되고 있습니다.


73-86: 새로운 PUT 엔드포인트 구현 우수

지원자 정보 수정을 위한 엔드포인트가 잘 구현되었습니다:

  • RESTful API 설계 원칙에 따라 PUT 메소드 사용
  • @PathVariable로 clubId와 appId를 적절히 받음
  • @Validated로 요청 검증 처리
  • @PreAuthorize@SecurityRequirement로 보안 처리
  • 명확한 Swagger 문서화

URL 경로 /apply/{appId}가 의미론적으로 적절하며, 응답 메시지도 명확합니다.

✨ 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/applicant-detail-edit

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.

@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 c4f8aa4.

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