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: 과제 제출이력 V2 도메인 구현 #937

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

uwoobeat
Copy link
Member

@uwoobeat uwoobeat commented Feb 26, 2025

🌱 관련 이슈

📌 작업 내용 및 특이사항

📝 참고사항

📚 기타

Summary by CodeRabbit

  • 신규 기능
    • 과제 제출 기록 관리 기능이 추가되어, 제출 상태와 처리 결과를 명확하게 확인할 수 있습니다.
    • 제출 성공 여부 확인 및 실패 처리 로직이 포함되어, 사용자에게 보다 투명한 과제 결과 관리를 제공합니다.

@uwoobeat uwoobeat requested a review from a team as a code owner February 26, 2025 12:43
@uwoobeat uwoobeat self-assigned this Feb 26, 2025
Copy link

coderabbitai bot commented Feb 26, 2025

📝 Walkthrough

Walkthrough

새로운 Java 클래스 AssignmentHistoryV2가 추가되었습니다. 이 클래스는 JPA 엔티티로 선언되어 과제 제출 내역을 관리하며, 제출 링크, 커밋 해시, 콘텐츠 길이, 제출 시각 등의 메타데이터를 포함합니다. 클래스는 StudySessionV2Member 엔티티와의 다대일 관계를 설정하고, 빌더 패턴을 활용한 정적 팩토리 메서드 create로 인스턴스 생성을 제어합니다. 또한, 제출 성공 여부를 확인하는 isSubmittedisSucceeded 메서드, 그리고 상태를 업데이트하는 successfail 메서드를 포함하여 제출 상태 전환과 유효성 검증을 수행합니다.

Changes

Files Changes
src/main/java/.../AssignmentHistoryV2.java 새 엔티티 클래스 추가. 정적 팩토리 메서드 create, 불리언 상태 확인 메서드(isSubmitted, isSucceeded), 상태 업데이트 메서드(success, fail) 및 실패 시 유효성 검증 로직 구현.

Sequence Diagram(s)

sequenceDiagram
    participant S as Service
    participant AH as AssignmentHistoryV2
    S->>AH: create(StudySessionV2, Member)
    AH-->>S: AssignmentHistoryV2 Instance
    alt Successful Submission
        S->>AH: success(submissionLink, commitHash, contentLength, committedAt)
        AH-->>S: Update success state
    else Failed Submission
        S->>AH: fail(submissionFailureType)
        AH-->>S: Throws CustomException (if invalid type)
    end
Loading

Possibly related PRs

Suggested labels

✨ feature

Poem

나는 코드를 뛰노는 작은 토끼,
새로운 AssignmentHistoryV2를 만들며 깨어났네.
제출의 성공과 실패, 모두 기록하니,
메서드들이 노래하는 코드 숲 속의 리듬.
한 걸음 한 걸음, 행복을 담아 뛰노는 토끼 🐰🌟.

Tip

CodeRabbit's docstrings feature is now available as part of our Pro Plan! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.

✨ Finishing Touches
  • 📝 Generate Docstrings

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

@uwoobeat
Copy link
Member Author

/gemini review

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: 2

🧹 Nitpick comments (2)
src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/AssignmentHistoryV2.java (2)

88-90: 메서드 이름과 로직의 명확성을 개선해보세요.

현재 isSubmitted()submissionFailureTypeNOT_SUBMITTED가 아닌지 확인합니다. 부정문을 사용한 로직은 혼란을 줄 수 있으므로, 더 직관적인 방식으로 변경하는 것이 좋습니다.

다음과 같이 수정해보세요:

public boolean isSubmitted() {
-    return submissionFailureType != NOT_SUBMITTED;
+    return submissionFailureType == NONE || 
+           (submissionFailureType != NOT_SUBMITTED && submissionFailureType != null);
}

또는 더 명확한 메서드 이름을 사용할 수도 있습니다:

-public boolean isSubmitted() {
+public boolean hasSubmissionAttempt() {
    return submissionFailureType != NOT_SUBMITTED;
}

107-117: 실패 유형 검증이 잘 구현되어 있습니다.

유효하지 않은 실패 유형에 대한 검증이 포함되어 있는 것은 좋습니다. 다만, 검증 로직을 더 명확하게 할 수 있습니다.

다음과 같이 열거형에 유효성 검사 메서드를 추가하거나 별도의 유틸리티 메서드를 만들어서 사용할 수 있습니다:

public void fail(SubmissionFailureType submissionFailureType) {
-    if (submissionFailureType == NOT_SUBMITTED || submissionFailureType == NONE) {
+    if (!isValidFailureType(submissionFailureType)) {
        throw new CustomException(ASSIGNMENT_INVALID_FAILURE_TYPE);
    }
    this.submissionLink = null;
    this.commitHash = null;
    this.contentLength = null;
    this.committedAt = null;
    this.submissionStatus = FAILURE;
    this.submissionFailureType = submissionFailureType;
}

+private boolean isValidFailureType(SubmissionFailureType type) {
+    return type != NOT_SUBMITTED && type != NONE;
+}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c3d3971 and 25c8f07.

📒 Files selected for processing (1)
  • src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/AssignmentHistoryV2.java (1 hunks)
🔇 Additional comments (6)
src/main/java/com/gdschongik/gdsc/domain/studyv2/domain/AssignmentHistoryV2.java (6)

29-35: 엔티티 구조 잘 설계되었습니다.

테이블 명과 유니크 제약조건이 적절하게 설정되어 있습니다. uniqueConstraints를 사용하여 동일한 스터디 세션에 대한 멤버별 제출 중복을 방지하는 것은 좋은 설계입니다.


42-46: 열거형 타입 사용이 적절합니다.

EnumType.STRING을 사용하여 데이터베이스에 문자열로 저장하는 방식은 유지보수성을 높여주며, 코드 이해도를 높이는 좋은 방법입니다.


57-63: 지연 로딩 사용이 적절합니다.

FetchType.LAZY를 사용하여 성능 최적화를 고려한 점이 좋습니다. 다만, N+1 문제가 발생할 수 있으니 조회 시 필요한 경우 fetch join을 사용해주세요.


65-75: 생성자 접근 제한이 잘 되어 있습니다.

빌더 패턴을 사용하여 객체 생성을 제한하고, 생성자를 private으로 선언한 것은 객체 생성을 통제하는 좋은 방법입니다.


77-84: 팩토리 메서드 패턴이 잘 적용되었습니다.

정적 팩토리 메서드를 통해 객체 생성 과정을 캡슐화하고, 기본값을 설정하는 접근 방식이 좋습니다.


98-105: 성공 처리 메서드의 구현이 적절합니다.

제출 성공 시 모든 필드가 적절하게 업데이트되고 있습니다. submissionFailureTypeNONE으로 설정하는 것도 좋은 접근입니다.

Comment on lines +35 to +118
public class AssignmentHistoryV2 {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "assignment_history_v2_id")
private Long id;

@Enumerated(EnumType.STRING)
private AssignmentSubmissionStatus submissionStatus;

@Enumerated(EnumType.STRING)
private SubmissionFailureType submissionFailureType;

private Integer contentLength;

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

private String commitHash;

private LocalDateTime committedAt;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "study_session_v2_id")
private StudySessionV2 studySession;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
private Member member;

@Builder(access = AccessLevel.PRIVATE)
private AssignmentHistoryV2(
AssignmentSubmissionStatus submissionStatus,
SubmissionFailureType submissionFailureType,
StudySessionV2 studySession,
Member member) {
this.submissionStatus = submissionStatus;
this.submissionFailureType = submissionFailureType;
this.studySession = studySession;
this.member = member;
}

public static AssignmentHistoryV2 create(StudySessionV2 studySession, Member member) {
return AssignmentHistoryV2.builder()
.submissionStatus(FAILURE)
.submissionFailureType(NOT_SUBMITTED)
.studySession(studySession)
.member(member)
.build();
}

// 데이터 조회 로직

public boolean isSubmitted() {
return submissionFailureType != NOT_SUBMITTED;
}

public boolean isSucceeded() {
return submissionStatus == SUCCESS;
}

// 데이터 변경 로직

public void success(String submissionLink, String commitHash, Integer contentLength, LocalDateTime committedAt) {
this.submissionLink = submissionLink;
this.commitHash = commitHash;
this.contentLength = contentLength;
this.committedAt = committedAt;
this.submissionStatus = SUCCESS;
this.submissionFailureType = NONE;
}

public void fail(SubmissionFailureType submissionFailureType) {
if (submissionFailureType == NOT_SUBMITTED || submissionFailureType == NONE) {
throw new CustomException(ASSIGNMENT_INVALID_FAILURE_TYPE);
}
this.submissionLink = null;
this.commitHash = null;
this.contentLength = null;
this.committedAt = null;
this.submissionStatus = FAILURE;
this.submissionFailureType = submissionFailureType;
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

널 체크와 파라미터 유효성 검증을 추가해보세요.

successfail 메서드에서 파라미터의 널 체크나 유효성 검증이 부족합니다. 외부에서 호출될 수 있는 메서드이므로 더 강건한 유효성 검증이 필요합니다.

다음과 같이 수정해볼 수 있습니다:

public void success(String submissionLink, String commitHash, Integer contentLength, LocalDateTime committedAt) {
+    // 필수 파라미터 널 체크
+    if (submissionLink == null || commitHash == null || committedAt == null) {
+        throw new CustomException(INVALID_INPUT_VALUE);
+    }
    this.submissionLink = submissionLink;
    this.commitHash = commitHash;
    this.contentLength = contentLength;
    this.committedAt = committedAt;
    this.submissionStatus = SUCCESS;
    this.submissionFailureType = NONE;
}

또한 commitHash의 형식 검증 등 추가적인 유효성 검증도 고려해볼 수 있습니다.

📝 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.

Suggested change
public class AssignmentHistoryV2 {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "assignment_history_v2_id")
private Long id;
@Enumerated(EnumType.STRING)
private AssignmentSubmissionStatus submissionStatus;
@Enumerated(EnumType.STRING)
private SubmissionFailureType submissionFailureType;
private Integer contentLength;
@Column(columnDefinition = "TEXT")
private String submissionLink;
private String commitHash;
private LocalDateTime committedAt;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "study_session_v2_id")
private StudySessionV2 studySession;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
private Member member;
@Builder(access = AccessLevel.PRIVATE)
private AssignmentHistoryV2(
AssignmentSubmissionStatus submissionStatus,
SubmissionFailureType submissionFailureType,
StudySessionV2 studySession,
Member member) {
this.submissionStatus = submissionStatus;
this.submissionFailureType = submissionFailureType;
this.studySession = studySession;
this.member = member;
}
public static AssignmentHistoryV2 create(StudySessionV2 studySession, Member member) {
return AssignmentHistoryV2.builder()
.submissionStatus(FAILURE)
.submissionFailureType(NOT_SUBMITTED)
.studySession(studySession)
.member(member)
.build();
}
// 데이터 조회 로직
public boolean isSubmitted() {
return submissionFailureType != NOT_SUBMITTED;
}
public boolean isSucceeded() {
return submissionStatus == SUCCESS;
}
// 데이터 변경 로직
public void success(String submissionLink, String commitHash, Integer contentLength, LocalDateTime committedAt) {
this.submissionLink = submissionLink;
this.commitHash = commitHash;
this.contentLength = contentLength;
this.committedAt = committedAt;
this.submissionStatus = SUCCESS;
this.submissionFailureType = NONE;
}
public void fail(SubmissionFailureType submissionFailureType) {
if (submissionFailureType == NOT_SUBMITTED || submissionFailureType == NONE) {
throw new CustomException(ASSIGNMENT_INVALID_FAILURE_TYPE);
}
this.submissionLink = null;
this.commitHash = null;
this.contentLength = null;
this.committedAt = null;
this.submissionStatus = FAILURE;
this.submissionFailureType = submissionFailureType;
}
}
public class AssignmentHistoryV2 {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "assignment_history_v2_id")
private Long id;
@Enumerated(EnumType.STRING)
private AssignmentSubmissionStatus submissionStatus;
@Enumerated(EnumType.STRING)
private SubmissionFailureType submissionFailureType;
private Integer contentLength;
@Column(columnDefinition = "TEXT")
private String submissionLink;
private String commitHash;
private LocalDateTime committedAt;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "study_session_v2_id")
private StudySessionV2 studySession;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
private Member member;
@Builder(access = AccessLevel.PRIVATE)
private AssignmentHistoryV2(
AssignmentSubmissionStatus submissionStatus,
SubmissionFailureType submissionFailureType,
StudySessionV2 studySession,
Member member) {
this.submissionStatus = submissionStatus;
this.submissionFailureType = submissionFailureType;
this.studySession = studySession;
this.member = member;
}
public static AssignmentHistoryV2 create(StudySessionV2 studySession, Member member) {
return AssignmentHistoryV2.builder()
.submissionStatus(FAILURE)
.submissionFailureType(NOT_SUBMITTED)
.studySession(studySession)
.member(member)
.build();
}
// 데이터 조회 로직
public boolean isSubmitted() {
return submissionFailureType != NOT_SUBMITTED;
}
public boolean isSucceeded() {
return submissionStatus == SUCCESS;
}
// 데이터 변경 로직
public void success(String submissionLink, String commitHash, Integer contentLength, LocalDateTime committedAt) {
// 필수 파라미터 널 체크
if (submissionLink == null || commitHash == null || committedAt == null) {
throw new CustomException(INVALID_INPUT_VALUE);
}
this.submissionLink = submissionLink;
this.commitHash = commitHash;
this.contentLength = contentLength;
this.committedAt = committedAt;
this.submissionStatus = SUCCESS;
this.submissionFailureType = NONE;
}
public void fail(SubmissionFailureType submissionFailureType) {
if (submissionFailureType == NOT_SUBMITTED || submissionFailureType == NONE) {
throw new CustomException(ASSIGNMENT_INVALID_FAILURE_TYPE);
}
this.submissionLink = null;
this.commitHash = null;
this.contentLength = null;
this.committedAt = null;
this.submissionStatus = FAILURE;
this.submissionFailureType = submissionFailureType;
}
}

Comment on lines +1 to +118
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(
name = "assignment_history_v2",
uniqueConstraints = {@UniqueConstraint(columnNames = {"study_session_v2_id", "member_id"})})
public class AssignmentHistoryV2 {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "assignment_history_v2_id")
private Long id;

@Enumerated(EnumType.STRING)
private AssignmentSubmissionStatus submissionStatus;

@Enumerated(EnumType.STRING)
private SubmissionFailureType submissionFailureType;

private Integer contentLength;

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

private String commitHash;

private LocalDateTime committedAt;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "study_session_v2_id")
private StudySessionV2 studySession;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
private Member member;

@Builder(access = AccessLevel.PRIVATE)
private AssignmentHistoryV2(
AssignmentSubmissionStatus submissionStatus,
SubmissionFailureType submissionFailureType,
StudySessionV2 studySession,
Member member) {
this.submissionStatus = submissionStatus;
this.submissionFailureType = submissionFailureType;
this.studySession = studySession;
this.member = member;
}

public static AssignmentHistoryV2 create(StudySessionV2 studySession, Member member) {
return AssignmentHistoryV2.builder()
.submissionStatus(FAILURE)
.submissionFailureType(NOT_SUBMITTED)
.studySession(studySession)
.member(member)
.build();
}

// 데이터 조회 로직

public boolean isSubmitted() {
return submissionFailureType != NOT_SUBMITTED;
}

public boolean isSucceeded() {
return submissionStatus == SUCCESS;
}

// 데이터 변경 로직

public void success(String submissionLink, String commitHash, Integer contentLength, LocalDateTime committedAt) {
this.submissionLink = submissionLink;
this.commitHash = commitHash;
this.contentLength = contentLength;
this.committedAt = committedAt;
this.submissionStatus = SUCCESS;
this.submissionFailureType = NONE;
}

public void fail(SubmissionFailureType submissionFailureType) {
if (submissionFailureType == NOT_SUBMITTED || submissionFailureType == NONE) {
throw new CustomException(ASSIGNMENT_INVALID_FAILURE_TYPE);
}
this.submissionLink = null;
this.commitHash = null;
this.contentLength = null;
this.committedAt = null;
this.submissionStatus = FAILURE;
this.submissionFailureType = submissionFailureType;
}
}
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

단위 테스트 구현이 필요합니다.

새로 추가된 도메인 클래스에 대한 단위 테스트가 필요합니다. 특히 isSubmitted(), isSucceeded(), success(), fail() 메서드에 대한 테스트가 중요합니다.

다음과 같은 테스트 케이스를 고려해보세요:

  1. create() 호출 시 기본 상태 확인
  2. success() 호출 후 상태 변경 확인
  3. fail() 호출 시 유효하지 않은 실패 유형에 대한 예외 발생 확인
  4. fail() 호출 후 상태 변경 확인
  5. isSubmitted()isSucceeded()가 각 상태에 맞게 정확한 값을 반환하는지 확인

🏁 Script executed:

#!/bin/bash
# 테스트 클래스 파일 존재 여부 확인
fd "AssignmentHistoryV2Test.java" src/test

Length of output: 42


단위 테스트 추가 구현 필요

현재 새로 추가된 AssignmentHistoryV2 도메인 클래스에 대한 단위 테스트가 존재하지 않는 것으로 확인되었습니다. 따라 아래의 테스트 케이스들을 포함하는 단위 테스트를 구현해 주세요:

  • create() 호출 시, 기본 상태가 올바르게 설정되었는지 검증
  • success() 호출 후, submissionLink, commitHash, contentLength, committedAt, submissionStatus, submissionFailureType 등 필드의 변경이 올바른지 확인
  • fail() 호출 시, 잘못된 실패 유형(NOT_SUBMITTED 또는 NONE) 입력 시 CustomException 발생 여부 검증
  • fail() 호출 후, 필드 초기화 및 상태 변경이 올바른지 확인
  • isSubmitted()isSucceeded() 메서드가 각각의 상태에 따라 정확한 값을 반환하는지 검증

해당 단위 테스트 파일은 src/test/AssignmentHistoryV2Test.java 경로 하에 추가해 주시기 바랍니다.

Copy link

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@uwoobeat
Copy link
Member Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The code introduces a new domain entity, AssignmentHistoryV2, to manage assignment submission history. The implementation appears well-structured and includes necessary fields and methods for tracking submission status, failure types, and submission details. However, there are a few areas where improvements can be made to enhance code clarity and maintainability.

Summary of Findings

  • Redundant Imports: The code imports AssignmentSubmissionStatus and SubmissionFailureType twice, once directly and once via static imports. This redundancy should be removed for clarity.
  • Naming Consistency: Consider renaming isSucceeded to isSuccess for better consistency with the SUCCESS enum value and general readability.
  • Exception Handling: The fail method throws a CustomException for invalid failure types. Ensure that this exception is appropriately handled in the calling code to prevent unexpected application behavior.

Assessment

The code introduces a new domain entity, AssignmentHistoryV2, to manage assignment submission history. The implementation appears well-structured and includes necessary fields and methods for tracking submission status, failure types, and submission details. However, there are a few areas where improvements can be made to enhance code clarity and maintainability. I recommend addressing these comments before merging, and also recommend that others review and approve this code before merging.

@uwoobeat uwoobeat merged commit cbf9b5f into develop Feb 26, 2025
2 checks passed
@uwoobeat uwoobeat deleted the feature/936-assignment-history-v2 branch February 26, 2025 12:56
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.

✨ 과제 제출이력 V2 도메인 구현
2 participants