-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DDING-109] Club 엔터티 formUrl 속성 제거 및 formId 속성 추가 #259
base: develop
Are you sure you want to change the base?
Conversation
Walkthrough전체 변경 사항은 여러 계층의 데이터 전송 객체(DTO), 명령(Command), 쿼리(Query) 및 엔티티에서 URL 형태의 Changes
Suggested labels
Suggested reviewers
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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)
src/main/java/ddingdong/ddingdongBE/domain/club/service/dto/command/UpdateClubInfoCommand.java (1)
23-23
: formId에 대한 유효성 검증이 필요합니다.
formId
가 필수 필드라면, null 체크나 유효성 검증 로직을 추가하는 것이 좋습니다.다음과 같이 검증 로직을 추가하는 것을 고려해보세요:
public Club toEntity() { + if (formId == null) { + throw new IllegalArgumentException("폼 ID는 필수 값입니다."); + } return Club.builder()Also applies to: 42-42
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/main/java/ddingdong/ddingdongBE/domain/club/controller/dto/request/UpdateClubInfoRequest.java
(2 hunks)src/main/java/ddingdong/ddingdongBE/domain/club/controller/dto/response/MyClubInfoResponse.java
(2 hunks)src/main/java/ddingdong/ddingdongBE/domain/club/controller/dto/response/UserClubResponse.java
(2 hunks)src/main/java/ddingdong/ddingdongBE/domain/club/entity/Club.java
(4 hunks)src/main/java/ddingdong/ddingdongBE/domain/club/service/dto/command/UpdateClubInfoCommand.java
(2 hunks)src/main/java/ddingdong/ddingdongBE/domain/club/service/dto/query/MyClubInfoQuery.java
(2 hunks)src/main/java/ddingdong/ddingdongBE/domain/club/service/dto/query/UserClubQuery.java
(2 hunks)src/main/resources/db/migration/V39__alter_table_club_drop_add_colmn.sql
(1 hunks)
🔇 Additional comments (5)
src/main/java/ddingdong/ddingdongBE/domain/club/service/dto/query/UserClubQuery.java (1)
20-20
: 변경사항이 적절합니다!
formUrl
에서formId
로의 변경이 일관되게 적용되었으며, 이는 딩동 플랫폼의 자체 폼 사용을 강제하는 PR의 목적에 부합합니다.Also applies to: 42-42
src/main/java/ddingdong/ddingdongBE/domain/club/service/dto/query/MyClubInfoQuery.java (1)
20-20
: 변경사항이 적절합니다!
UserClubQuery
와 동일한 패턴으로formId
필드가 일관되게 구현되었습니다.Also applies to: 43-43
src/main/resources/db/migration/V39__alter_table_club_drop_add_colmn.sql (1)
1-7
: 데이터 마이그레이션 계획 확인 필요기존
form_url
데이터를form_id
로 변환하는 마이그레이션 계획이 필요합니다.다음 사항들을 확인해 주세요:
- 기존
form_url
데이터를form_id
로 매핑하는 방법- 매핑할 수 없는 데이터 처리 방안
- 데이터 손실 가능성 검토
src/main/java/ddingdong/ddingdongBE/domain/club/controller/dto/response/UserClubResponse.java (1)
40-41
: 변경사항이 적절합니다!
formId
필드의 스키마 문서화가 명확하고, 엔티티 변경사항과 일관성이 있습니다.src/main/java/ddingdong/ddingdongBE/domain/club/controller/dto/response/MyClubInfoResponse.java (1)
40-41
: 변경사항이 적절합니다!
formId
필드의 스키마 문서화가 명확하고,UserClubResponse
와 일관성이 있습니다.
@Schema(description = "모집 폼 아이디", example = "6") | ||
Long formId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
formId 필드에 @NotNull 제약조건이 필요합니다.
모집 폼이 필수라면, 다른 필수 필드들처럼 @NotNull
어노테이션과 적절한 메시지를 추가해야 합니다.
다음과 같이 수정하는 것을 추천드립니다:
@Schema(description = "모집 폼 아이디", example = "6")
+@NotNull(message = "모집 폼 아이디는 필수로 입력해야 합니다.")
Long formId,
📝 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.
@Schema(description = "모집 폼 아이디", example = "6") | |
Long formId, | |
@Schema(description = "모집 폼 아이디", example = "6") | |
@NotNull(message = "모집 폼 아이디는 필수로 입력해야 합니다.") | |
Long formId, |
@@ -70,7 +70,7 @@ public class Club extends BaseEntity { | |||
|
|||
private String ideal; | |||
|
|||
private String formUrl; | |||
private Long formId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
formId 유효성 검증 추가 필요
formId
가 유효한 Form을 참조하는지 확인하는 로직이 필요합니다.
다음과 같은 검증 메서드 추가를 제안합니다:
private void validateFormId(Long formId) {
if (formId == null) {
throw new IllegalArgumentException("Form ID는 필수 값입니다.");
}
// TODO: Form 존재 여부 확인 로직 추가
}
클라이언트에서 직접 formId 업데이트를 요청할 일이 없을 것 같아 삭제했습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/ddingdong/ddingdongBE/domain/club/entity/Club.java (1)
123-126
: 메서드 이름과 실제 동작이 일치하지 않음
addClubMember
메서드 내부에서 호출하는setClubFormConvenience
는 메서드 이름과 일치하지 않는 동작을 수행하는 것으로 보입니다.메서드 이름을 실제 동작과 일치하도록 변경하거나, 메서드의 목적을 명확히 하는 주석을 추가해 주세요.
- clubMember.setClubFormConvenience(this); + clubMember.setClub(this); // 클럽 멤버와 클럽 간의 양방향 관계 설정
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/ddingdong/ddingdongBE/domain/club/entity/Club.java
(1 hunks)src/main/resources/db/migration/V39__alter_table_club_drop_colmn.sql
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/main/resources/db/migration/V39__alter_table_club_drop_colmn.sql
🔇 Additional comments (1)
src/main/java/ddingdong/ddingdongBE/domain/club/entity/Club.java (1)
34-78
:⚠️ Potential issueformId 필드 추가 필요
PR 목적에 따라
formUrl
을 제거하고formId
를 추가하는 것이 필요하지만,formId
필드가 구현되지 않았습니다.다음과 같이
formId
필드를 추가해 주세요:@Column(name = "deleted_at", columnDefinition = "TIMESTAMP") private LocalDateTime deletedAt; + private Long formId;
이전 리뷰에서 제안된 대로
formId
유효성 검증도 함께 추가해 주세요.
🚀 작업 내용
지원하기 폼지 연결을 띵동 자체 폼지로 강제하기 위하여
Club 엔터티 formUrl 속성 제거 및 formId 속성 추가하였습니다.
🤔 고민했던 내용
formUrl을 완전히 삭제해도 되는지 궁금합니다.
💬 리뷰 중점사항
Summary by CodeRabbit