Skip to content
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

feat: Study V2 도메인 구현 #853

Merged
merged 12 commits into from
Jan 28, 2025
Merged

Conversation

uwoobeat
Copy link
Member

@uwoobeat uwoobeat commented Jan 28, 2025

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 신규 요구사항은 849 참고해주세요.
  • 스터디 애그리거트에 대하여 스터디 엔티티가 애그리거트 루트 역할을 하고, 스터디회차의 경우 애그리거트 루트에 의해 생명주기가 관리되기 때문에 일대다 양방향 연관관계로 설정하고, 독립적으로 생성될 수 없도록 create 정적 팩토리가 void를 반환하도록 했습니다 (중요) ****

📝 참고사항

📚 기타

Summary by CodeRabbit

  • 새로운 기능

    • 학기(Semester) 관리를 위한 새로운 도메인 클래스 추가
    • 스터디 세션(StudySessionV2) 및 스터디(StudyV2) 관리를 위한 새로운 도메인 클래스 도입
  • 리팩토링

    • 모집 라운드 검증 로직에 대한 주석 추가 및 향후 개선 계획 표시

이번 릴리즈는 스터디 관리 시스템의 도메인 모델을 확장하고 개선하는 데 중점을 두었습니다.

@uwoobeat uwoobeat self-assigned this Jan 28, 2025
@uwoobeat uwoobeat requested a review from a team as a code owner January 28, 2025 12:15
Copy link

coderabbitai bot commented Jan 28, 2025

Warning

Rate limit exceeded

@uwoobeat has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 28 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 0723668 and 2d47f1c.

📒 Files selected for processing (2)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/StudySessionV2.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/StudyV2.java (1 hunks)

워크스루

이 풀 리퀘스트는 Study V2 도메인 구현을 위한 주요 클래스들을 추가하고 있습니다. Semester 값 객체, StudySessionV2, StudyV2 클래스가 새롭게 도입되었으며, 이는 스터디 관리를 위한 도메인 모델을 확장하고 있습니다. 각 클래스는 JPA 어노테이션과 Lombok을 활용하여 엔티티 매핑과 생성자 로직을 정의하고 있습니다.

변경 사항

파일 변경 요약
src/main/java/com/gdschongik/gdsc/domain/common/vo/Semester.java Semester 값 객체 추가, 학년도와 학기 타입을 포함
src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/StudySessionV2.java 스터디 세션 엔티티 추가, 레슨 및 과제 기간 포함
src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/StudyV2.java 스터디 엔티티 추가, 스터디 세션과의 관계 정의
src/main/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentRoundValidator.java 기간 중복 검증 관련 주석 추가

연결된 이슈 평가

목표 해결 여부 설명
BaseSemesterEntity 제거 및 Semester VO 구현 [#845]

관련 가능성 있는 PR

제안된 라벨

✨ feature, ⚓ Domain: Study

제안된 리뷰어

  • Sangwook02
  • kckc0608
  • AlmondBreez3

시 (토끼의 노래)

🐰 새로운 도메인이 피어나네
스터디의 세계가 꽃피어
Semester와 StudyV2가 손잡고
코드의 정원을 일구어가네
기술의 토끼, 즐겁게 뛰어!


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?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @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. (Beta)
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • 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

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

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link

@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: 0

🧹 Nitpick comments (3)
src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/StudySessionV2.java (1)

61-63: [제안] 부모 엔티티에서 자식 엔티티의 생명주기를 명확히 제어하기 위한 설정 고민
@ManyToOne을 통해 양방향 관계를 맺고 있습니다. StudyV2가 애그리거트 루트라면, 필요 시 cascade = CascadeType.ALL 또는 orphanRemoval = true 등을 고려하셔서 자식 엔티티의 생명주기를 명확히 제어할 수 있습니다.

src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/StudyV2.java (1)

92-93: [제안] 애그리거트 루트의 자식 엔티티 관리 시점 재검토
@OneToMany(mappedBy = "studyV2")로 자식 엔티티를 보유하고 있습니다. StudySessionV2의 생명주기를 StudyV2에서 온전히 관리하려면 cascadeorphanRemoval 옵션을 추가 고려해 볼 수 있습니다.

src/main/java/com/gdschongik/gdsc/domain/common/vo/Semester.java (1)

18-21: [사소한 제안] 학년도와 학기 타입에 대한 기본 유효성 검증 고려
academicYearsemesterType에 대해 적절한 범위나 값 검증이 추가되면 도메인 무결성을 더 강화할 수 있습니다.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d2df1e2 and 8a289c4.

📒 Files selected for processing (4)
  • src/main/java/com/gdschongik/gdsc/domain/common/vo/Semester.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentRoundValidator.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/StudySessionV2.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/StudyV2.java (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/recruitment/domain/RecruitmentRoundValidator.java
🔇 Additional comments (2)
src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/StudySessionV2.java (2)

25-26: [주석] Lombok과 JPA 엔티티 결합 사용이 적절해 보입니다.
이 부분은 @RequiredArgsConstructor(access = AccessLevel.PROTECTED)로 JPA 스펙을 준수하고 있어 무난해 보입니다.


90-107: [확인 요망] create 메서드 내부에서 빌더 결과를 반환 또는 활용하지 않는 로직
create 메서드에서 StudySessionV2.builder().build()로 새로운 객체를 만든 뒤 반환값 없이 종료됩니다.
물론 빌더로 생성된 객체가 생성자 내부에서 studyV2.getStudySessions().add(this);를 호출하고 있지만, 실제로 호출부에서 반환값이 없어도 문제없이 세션이 영속화되는지(혹은 분리/삭제 시점에서 문제없는지) 확인이 필요합니다.

Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link
Member

@Sangwook02 Sangwook02 left a comment

Choose a reason for hiding this comment

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

확인했습니다

private Semester semester;

@Comment("총 회차 수")
private Integer totalWeek;
Copy link
Member

Choose a reason for hiding this comment

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

변수명도 회차라는 의미 담아서 다시 지으면 어떤가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

totalRound로 가겠읍니다

@Column(columnDefinition = "TEXT")
private String descriptionNotionLink;

@Enumerated(EnumType.STRING)
Copy link
Member

Choose a reason for hiding this comment

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

@Enumerated(EnumType.STRING) 필요한가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Embedded 인데 실수했네요 굿

Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link
Member

@Sangwook02 Sangwook02 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link
Member

@kckc0608 kckc0608 left a comment

Choose a reason for hiding this comment

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

엔티티 필드 순서 미리 맞추는 것만 코멘트 남겼습니다

Comment on lines 90 to 92
public void create(
String title,
String description,
Copy link
Member

Choose a reason for hiding this comment

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

혹시 static 키워드 있어야 하지 않나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

깜빡했네요 수정완

Comment on lines +44 to +52
@Embedded
@AttributeOverride(name = "startDate", column = @Column(name = "lesson_start_at"))
@AttributeOverride(name = "endDate", column = @Column(name = "lesson_end_at"))
private Period lessonPeriod;

// 과제 관련 필드

@Comment("과제 명세 링크")
private String assignmentDescriptionLink;
Copy link
Member

Choose a reason for hiding this comment

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

임베디드랑 일반 필드 순서 맞추는 거 새로운 엔티티에서는 미리 맞춰둬도 좋을 거 같아요

Copy link
Member Author

Choose a reason for hiding this comment

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

그그그그 이거 하면서 좀 생각을 해봤는데, 일반 필드 -> VO는 꼭 맞춰야 하나? 싶더라고요.
요 케이스처럼 필드 성격에 따라 묶이는 게 적절할 것 같은 케이스도 있고...

물론 ID -> 상태 / 타입 -> 일반 / VO 필드 -> 참조 필드 순서는 지키되 일반/VO는 굳이 안지켜도 될 것 같은데 어떻게 생각하시나용

Copy link
Member

Choose a reason for hiding this comment

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

음 저도 성격에 따라 묶는 게 더 좋은 것 같아요 그럼 이대로 가죠 ㅎㅎ

Copy link
Member Author

Choose a reason for hiding this comment

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

굿입니다 그 필드 순서 이슈 작업 건에서도 참고해주세용

Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link
Member

@kckc0608 kckc0608 left a comment

Choose a reason for hiding this comment

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

lgtm

@uwoobeat uwoobeat merged commit 3f5ea6e into develop Jan 28, 2025
1 check passed
@uwoobeat uwoobeat deleted the feature/845-study-v2-domain branch January 28, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Study V2 도메인 구현
3 participants