Skip to content

feat/KD-43 Thesis, Certificate 도메인 엔티티 모델 물리 모델링#275

Merged
LeeHanEum merged 5 commits intodevelopfrom
feat/KD-43
Nov 11, 2025
Merged

feat/KD-43 Thesis, Certificate 도메인 엔티티 모델 물리 모델링#275
LeeHanEum merged 5 commits intodevelopfrom
feat/KD-43

Conversation

@LeeHanEum
Copy link
Copy Markdown
Member

Summary

Thesis, Certificate 도메인 모델과 엔티티 모델을 구현합니다.

Tasks

  • Thesis, Certificate 도메인 엔티티 모델 물리 모델링

To Reviewer

도메인 간 강한 결합도를 제거하기 위해 scheduleId에 JoinColumn과 외래키를 걸지 않았고
다만 성능 향상을 위해 인덱스를 추가하였습니다.

Screenshot

(없을 경우 삭제) 작업한 내용에 대한 스크린샷을 첨부해주세요.

@LeeHanEum LeeHanEum self-assigned this Nov 6, 2025
@LeeHanEum LeeHanEum added the ✨feature create new feature label Nov 6, 2025
@LeeHanEum LeeHanEum linked an issue Nov 6, 2025 that may be closed by this pull request
1 task
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 6, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Certificate과 Thesis 도메인을 위해 도메인 엔티티 클래스 2개와 JPA 엔티티 클래스 2개를 추가하는 변경사항. 각 도메인 클래스는 Lombok @Getter와 정적 팩토리 메서드를 제공하며, 각 JPA 엔티티는 도메인 및 엔티티 간 변환을 위한 정적 매퍼 메서드를 포함.

Changes

Cohort / File(s) 변경 요약
Certificate 도메인 및 인프라
aics-domain/src/main/java/kgu/developers/domain/certificate/domain/Certificate.java, aics-domain/src/main/java/kgu/developers/domain/certificate/infrastructure/entity/CertificateJpaEntity.java
새로운 Certificate 도메인 엔티티와 CertificateJpaEntity JPA 엔티티 클래스 추가. 도메인 클래스는 Lombok @Getter와 of() 팩토리 메서드 포함. JPA 엔티티는 BaseTimeEntity 확장, @Builder 및 toEntity()/toDomain() 매퍼 메서드 포함
Thesis 도메인 및 인프라
aics-domain/src/main/java/kgu/developers/domain/thesis/domain/Thesis.java, aics-domain/src/main/java/kgu/developers/domain/thesis/infrastructure/entity/ThesisJpaEntity.java
새로운 Thesis 도메인 엔티티와 ThesisJpaEntity JPA 엔티티 클래스 추가. 도메인 클래스는 Lombok @Getter와 of() 팩토리 메서드 포함. JPA 엔티티는 BaseTimeEntity 확장, @Builder 및 toEntity()/toDomain() 매퍼 메서드 포함

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • 도메인 엔티티와 JPA 엔티티의 반복되는 패턴으로 인해 검토 복잡도 감소
  • Certificate과 Thesis 두 도메인 모두 동일한 구조 및 필드 배치 패턴 준수
  • 매퍼 메서드 로직의 일관성 확인 필요 (toEntity/toDomain 변환 로직)
  • Lombok 설정 및 접근 제어자(private/protected) 검증 필요

Possibly related issues

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경 사항의 핵심을 명확하게 설명합니다. Thesis, Certificate 도메인 엔티티의 물리 모델링을 구현한다는 내용이 요약되어 있습니다.
Description check ✅ Passed PR 설명이 변경 사항과 관련되어 있습니다. Thesis, Certificate 도메인 모델 구현, 스케줄 ID 인덱싱 전략 등의 내용을 포함하고 있습니다.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 6, 2025

Test Coverage Report

Overall Project 83.08% -2.58% 🍏
Files changed 0%

Module Coverage
aics-domain 75.92% -3.68%
Files
Module File Coverage
aics-domain Certificate.java 0%
Thesis.java 0%

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...elopers/domain/certificate/domain/Certificate.java 0.00% 9 Missing ⚠️
...va/kgu/developers/domain/thesis/domain/Thesis.java 0.00% 9 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (10.00%). You can increase the patch coverage or adjust the target coverage.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop     #275      +/-   ##
=============================================
- Coverage      83.70%   81.00%   -2.71%     
  Complexity       164      164              
=============================================
  Files             55       57       +2     
  Lines            540      558      +18     
  Branches           5        5              
=============================================
  Hits             452      452              
- Misses            82      100      +18     
  Partials           6        6              
Files with missing lines Coverage Δ Complexity Δ
...elopers/domain/certificate/domain/Certificate.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...va/kgu/developers/domain/thesis/domain/Thesis.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4835cb1...898f406. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
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: 4

🧹 Nitpick comments (6)
aics-domain/src/main/java/kgu/developers/domain/thesis/domain/Thesis.java (2)

7-15: 도메인 객체의 불변성을 보장하기 위해 필드를 final로 선언하는 것을 권장합니다.

현재 필드들이 final이 아니어서 객체 생성 후에도 값이 변경될 수 있습니다. 도메인 객체는 일반적으로 불변 객체로 설계하여 안전성을 보장합니다.

다음과 같이 필드를 final로 변경하는 것을 고려하세요:

 @Getter
 public class Thesis {
-	private Long id;
-	private Long scheduleId;
-	private Long thesisFileId;
-	private boolean approval;
-	private LocalDateTime createdAt;
-	private LocalDateTime updatedAt;
-	private LocalDateTime deletedAt;
+	private final Long id;
+	private final Long scheduleId;
+	private final Long thesisFileId;
+	private final boolean approval;
+	private final LocalDateTime createdAt;
+	private final LocalDateTime updatedAt;
+	private final LocalDateTime deletedAt;

17-34: 팩토리 메서드에서 입력 값에 대한 검증을 추가하는 것을 고려하세요.

현재 null 값이나 유효하지 않은 값에 대한 검증이 없어 잘못된 도메인 객체가 생성될 수 있습니다. 비즈니스 규칙에 따라 필수 필드(예: scheduleId, thesisFileId)에 대한 검증을 추가하면 도메인 무결성을 보장할 수 있습니다.

aics-domain/src/main/java/kgu/developers/domain/certificate/domain/Certificate.java (3)

7-15: 도메인 객체의 불변성을 보장하기 위해 필드를 final로 선언하는 것을 권장합니다.

현재 필드들이 final이 아니어서 객체 생성 후에도 값이 변경될 수 있습니다. 도메인 객체는 일반적으로 불변 객체로 설계하여 안전성을 보장합니다. (이 이슈는 Thesis.java에서도 동일하게 발견되었습니다.)


17-34: 팩토리 메서드에서 입력 값에 대한 검증을 추가하는 것을 고려하세요.

현재 null 값이나 유효하지 않은 값에 대한 검증이 없어 잘못된 도메인 객체가 생성될 수 있습니다. 비즈니스 규칙에 따라 필수 필드(예: scheduleId, certificateFileId)에 대한 검증을 추가하면 도메인 무결성을 보장할 수 있습니다.


7-34: 코드 중복: ThesisCertificate 도메인 클래스의 구조가 동일합니다.

두 클래스가 필드명(thesisFileId vs certificateFileId)을 제외하고 거의 동일한 구조를 가지고 있습니다. 향후 유지보수성을 위해 공통 베이스 클래스나 제네릭을 활용한 추상화를 고려할 수 있지만, 도메인의 독립성을 유지하는 것도 중요하므로 현재 구조를 유지하는 것도 타당합니다.

이 부분은 팀의 아키텍처 방향성에 따라 결정하시면 됩니다.

aics-domain/src/main/java/kgu/developers/domain/certificate/infrastructure/entity/CertificateJpaEntity.java (1)

19-65: 코드 중복: ThesisJpaEntityCertificateJpaEntity의 구조가 동일합니다.

두 JPA 엔티티 클래스가 필드명(thesisFileId vs certificateFileId)과 테이블명을 제외하고 거의 동일한 구조를 가지고 있습니다. 향후 유지보수 시 변경사항을 두 곳에 모두 적용해야 하는 번거로움이 있을 수 있습니다.

그러나 도메인의 독립성과 명확성을 유지하는 것도 중요하므로, 현재 구조를 유지하는 것도 타당한 선택입니다. 이 부분은 팀의 아키텍처 방향성에 따라 결정하시면 됩니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 374c7c0 and cb0ab2b.

📒 Files selected for processing (4)
  • aics-domain/src/main/java/kgu/developers/domain/certificate/domain/Certificate.java (1 hunks)
  • aics-domain/src/main/java/kgu/developers/domain/certificate/infrastructure/entity/CertificateJpaEntity.java (1 hunks)
  • aics-domain/src/main/java/kgu/developers/domain/thesis/domain/Thesis.java (1 hunks)
  • aics-domain/src/main/java/kgu/developers/domain/thesis/infrastructure/entity/ThesisJpaEntity.java (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
aics-domain/src/main/java/kgu/developers/domain/thesis/infrastructure/entity/ThesisJpaEntity.java (1)
aics-domain/src/main/java/kgu/developers/domain/certificate/infrastructure/entity/CertificateJpaEntity.java (1)
  • Builder (19-66)
aics-domain/src/main/java/kgu/developers/domain/certificate/infrastructure/entity/CertificateJpaEntity.java (1)
aics-domain/src/main/java/kgu/developers/domain/thesis/infrastructure/entity/ThesisJpaEntity.java (1)
  • Builder (19-66)
🔇 Additional comments (6)
aics-domain/src/main/java/kgu/developers/domain/thesis/infrastructure/entity/ThesisJpaEntity.java (3)

19-27: LGTM! Lombok 어노테이션과 접근 제어자가 적절하게 구성되었습니다.

@NoArgsConstructor(access = PROTECTED)@AllArgsConstructor(access = PRIVATE)를 사용하여 JPA 요구사항을 충족하면서도 불필요한 외부 접근을 차단하고 있습니다.


21-25: 인덱스 추가가 적절합니다.

schedule_id에 대한 인덱스를 추가하여 조회 성능을 향상시켰습니다. PR 설명에서 언급한 대로 scheduleId@JoinColumn이나 외래 키를 설정하지 않아 도메인 간 강한 결합을 피하면서도 성능은 확보한 설계입니다.


42-49: 타임스탬프 필드 처리 방식을 검토하세요.

toEntity() 메서드가 도메인 객체의 createdAt, updatedAt, deletedAt 값을 엔티티로 복사하지 않습니다. BaseTimeEntity가 이러한 필드를 자동으로 관리하지만, 기존 도메인 객체를 엔티티로 변환할 때 타임스탬프를 보존해야 하는 경우(예: 업데이트 작업)에는 문제가 될 수 있습니다.

새로운 엔티티 생성 시에만 toEntity()를 사용하는지 확인하고, 기존 엔티티 업데이트 시나리오도 고려하세요.

aics-domain/src/main/java/kgu/developers/domain/certificate/infrastructure/entity/CertificateJpaEntity.java (3)

19-27: LGTM! Lombok 어노테이션과 접근 제어자가 적절하게 구성되었습니다.

@NoArgsConstructor(access = PROTECTED)@AllArgsConstructor(access = PRIVATE)를 사용하여 JPA 요구사항을 충족하면서도 불필요한 외부 접근을 차단하고 있습니다.


21-25: 인덱스 추가가 적절합니다.

schedule_id에 대한 인덱스를 추가하여 조회 성능을 향상시켰습니다. PR 설명에서 언급한 대로 scheduleId@JoinColumn이나 외래 키를 설정하지 않아 도메인 간 강한 결합을 피하면서도 성능은 확보한 설계입니다.


42-49: 타임스탬프 필드 처리 방식을 검토하세요.

toEntity() 메서드가 도메인 객체의 createdAt, updatedAt, deletedAt 값을 엔티티로 복사하지 않습니다. BaseTimeEntity가 이러한 필드를 자동으로 관리하지만, 기존 도메인 객체를 엔티티로 변환할 때 타임스탬프를 보존해야 하는 경우(예: 업데이트 작업)에는 문제가 될 수 있습니다.

새로운 엔티티 생성 시에만 toEntity()를 사용하는지 확인하고, 기존 엔티티 업데이트 시나리오도 고려하세요.

Copy link
Copy Markdown
Contributor

@JangYeongHu JangYeongHu 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
Copy Markdown
Contributor

@dkdltm221 dkdltm221 left a comment

Choose a reason for hiding this comment

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

LGTM👍🏻

@LeeHanEum LeeHanEum merged commit 9c55f13 into develop Nov 11, 2025
4 of 5 checks passed
@LeeHanEum LeeHanEum deleted the feat/KD-43 branch November 11, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨feature create new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thesis, Certificate 도메인 및 엔티티 물리 모델링

3 participants