[feature] 지원서의 메모를 수정할 수 있다.#620
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Warning
|
| 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 |
필드명 questionId를 id로 변경, 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: 성공 응답
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~15–20 minutes
Possibly related issues
- [feature] MOA-131 동아리 지원자 응답결과에 날짜와 메모를 응답하고 메모를 수정할 수 있다. #617: 클럽 지원자 메모 및 응답일자 수정 기능 구현 요구와 본 PR의 변경 사항이 정확히 일치합니다.
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
📒 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.javabackend/src/main/java/moadong/club/repository/ClubApplicationRepository.javabackend/src/main/java/moadong/club/entity/ClubApplication.javabackend/src/main/java/moadong/club/payload/dto/ClubApplicantsResult.javabackend/src/main/java/moadong/club/payload/request/ClubApplicantEditRequest.javabackend/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.javabackend/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:ClubApplicantsResultDTO의questionId→id필드명 변경 영향 없음 확인
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.
🪧 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
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.
- PR comments: Tag
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai generate unit teststo generate unit tests for this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere 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.
Test Results75 tests 75 ✅ 2s ⏱️ Results for commit c4f8aa4. |
#️⃣연관된 이슈
#617
📝작업 내용
지원자 응답 날짜 추가
지원자 메모 필드 추가
지원자 메모 필드 수정
중점적으로 리뷰받고 싶은 부분(선택)
논의하고 싶은 부분(선택)
🫡 참고사항
Summary by CodeRabbit
신규 기능
버그 수정
기타