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: 과제 히스토리 테이블 추가 #570

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

Sangwook02
Copy link
Member

@Sangwook02 Sangwook02 commented Aug 4, 2024

🌱 관련 이슈

📌 작업 내용 및 특이사항

📝 참고사항

📚 기타

Summary by CodeRabbit

Summary by CodeRabbit

  • 새로운 기능

    • 과제 제출 이력을 관리하는 AssignmentHistory 클래스가 추가되었습니다.
    • 과제 제출 상태를 관리하는 AssignmentSubmissionStatus 열거형이 도입되었습니다.
    • 제출 실패 유형을 분류하는 SubmissionFailureType 열거형이 새로 추가되었습니다.
  • 버그 수정

    • 과제 제출 상태에 대한 명확성을 높이고 오류 가능성을 줄였습니다.

@Sangwook02 Sangwook02 added the ✨ feature 새로운 기능 추가 및 수정 label Aug 4, 2024
@Sangwook02 Sangwook02 self-assigned this Aug 4, 2024
@Sangwook02 Sangwook02 requested a review from a team as a code owner August 4, 2024 11:36
Copy link

coderabbitai bot commented Aug 4, 2024

Walkthrough

새로 도입된 AssignmentHistory 클래스는 과제 제출의 이력을 관리하는 엔티티로, StudyDetailMember와의 관계를 통해 각 과제의 제출 정보를 추적합니다. AssignmentSubmissionStatusSubmissionFailureType 열거형을 통해 다양한 제출 상태와 실패 유형을 정의하며, 코드의 명확성과 유지 보수성을 높입니다.

Changes

파일 경로 변경 요약
src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistory.java 새로운 AssignmentHistory 클래스 추가, 과제 이력 추적을 위한 필드 및 메서드 정의
src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentSubmissionStatus.java AssignmentSubmissionStatus 열거형 추가, 제출 상태 정의 및 간소화된 코드 적용
src/main/java/com/gdschongik/gdsc/domain/study/domain/SubmissionFailureType.java SubmissionFailureType 열거형 추가, 제출 실패 유형 정의

Assessment against linked issues

Objective Addressed Explanation
과제 히스토리 테이블 추가 (#567)

Poem

🐰
새로운 과제의 히스토리,
제출의 여정, 기록의 미소.
상태의 변화, 자연의 흐름,
코딩의 숲에서 춤을 춰요.
함께하는 이들과, 기쁨의 노래! 🎶


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

github-actions bot commented Aug 4, 2024

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0ec74c0 and eb08f3c.

Files selected for processing (2)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistory.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentSubmissionStatus.java (1 hunks)
Additional comments not posted (5)
src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentSubmissionStatus.java (2)

1-5: 패키지 선언 및 임포트가 적절합니다.

패키지 선언과 임포트는 표준적이며 해당 컨텍스트에 적합합니다.


6-14: 열거형 선언 및 상수가 적절합니다.

AssignmentSubmissionStatus 열거형은 네 개의 상수를 정의하고 있으며, 각 상수에 연결된 문자열 값은 과제 제출 컨텍스트에서 명확하고 의미가 있습니다.

src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistory.java (3)

1-19: 패키지 선언 및 임포트가 적절합니다.

패키지 선언과 임포트는 표준적이며 해당 컨텍스트에 적합합니다.


20-47: 클래스 선언, 애노테이션 및 필드가 적절합니다.

AssignmentHistory 클래스는 JPA와 Lombok 애노테이션으로 잘 구조화되어 있으며, 필드는 과제 이력에 필요한 모든 정보를 포함하고 있습니다.


48-79: 생성자 및 빌더 메서드가 적절합니다.

빌더 패턴이 올바르게 구현되었으며, 정적 팩토리 메서드는 가독성과 사용성을 높입니다.

Copy link
Member

@AlmondBreez3 AlmondBreez3 left a comment

Choose a reason for hiding this comment

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

LGTM

private Member member;

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

Choose a reason for hiding this comment

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

사실 링크는 별도로 관리하지 않아도 되긴 하겠지만...
이미지 기능과 마찬가지로 매번 url을 빌딩해서 리턴하려면 번거로움이 있을 것 같으니
제출할 때 그냥 문자열로 만들어서 저장해버리면 괜찮긴 하겠네요


private String commitHash;

private long length;
Copy link
Member

Choose a reason for hiding this comment

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

content_length가 더 적절할 것 같아요. 그냥 length라고 하면 좀 모호한 것 같습니다
그리고 nullable한 값이라면 wrapper 타입 사용하시는게 좋을듯 합니다

Copy link
Member Author

Choose a reason for hiding this comment

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

과제를 제출하는 시점에 AssignmentHistory가 생성된다고 생각해서 length가 nullable하지 않다고 생각했어요
근데 수강신청 하는 시점에 생성한다면 nullable한 값이 될 것 같고, 과제 제출 시점보단 수강신청 시점에 생성하는게 적절할 것 같네요!

수정하고, 수강 신청 api는 별도 이슈에서 수정할게요~

NOT_SUBMITTED("미제출"),
WORD_COUNT_INSUFFICIENT("글자수 부족"),
LOCATION_UNIDENTIFIABLE("위치 확인불가"),
SUBMISSION_SUCCESS("제출 성공");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
SUBMISSION_SUCCESS("제출 성공");
SUCCESS("제출 성공");


@Getter
@RequiredArgsConstructor
public enum AssignmentSubmissionStatus {
Copy link
Member

Choose a reason for hiding this comment

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

개인적인 생각인데 성공 / 실패 여부를 나타내는 필드와, 실패 사유를 나타내는 필드를 분리하는 건 어떨까요?
서비스가 고도화된다면 실패 케이스도 여러 가지가 생길 것 같은데, 대부분의 관심사는 성공했는지 실패했는지일 것이고
사용자한테 사유 알려줄 때만 실패 세부 케이스가 필요해질 것 같아서 이게 더 괜찮지 않나 싶네요

토스페이먼츠 연동하면서 API 스펙을 좀 봤는데, 여기도 결제에 대해서 결제 성공 / 실패 여부에 대한 enum 값 외에도
실패에 대한 사유를 다루는 별도 필드를 두는 경우가 있더라고요. 이쪽도 실패 케이스가 복잡해지면서 이렇게 구현한 것 같았습니다

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

github-actions bot commented Aug 6, 2024

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between eb08f3c and 9f999bc.

Files selected for processing (2)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistory.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentSubmissionStatus.java (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistory.java
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentSubmissionStatus.java

Copy link

github-actions bot commented Aug 6, 2024

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9f999bc and 660a7e9.

Files selected for processing (3)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistory.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentSubmissionStatus.java (1 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/SubmissionFailureType.java (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/SubmissionFailureType.java
Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentSubmissionStatus.java
Additional comments not posted (6)
src/main/java/com/gdschongik/gdsc/domain/study/domain/AssignmentHistory.java (6)

1-14: 패키지 및 임포트 확인 완료

패키지 및 임포트가 적절하게 설정되었습니다.


15-23: 클래스 어노테이션 및 정의 확인 완료

Lombok 어노테이션과 엔티티 정의가 적절하게 설정되었습니다.


25-36: ID 및 관계 설정 확인 완료

ID 생성 전략과 StudyDetailMember와의 관계가 적절하게 정의되었습니다.


38-49: 컬럼 및 열거형 확인 완료

컬럼 정의와 열거형 사용이 적절하게 설정되었습니다.


51-65: 빌더 및 생성자 확인 완료

빌더와 생성자가 적절하게 정의되고 사용되었습니다.


67-77: 정적 팩토리 메서드 확인 완료

정적 팩토리 메서드가 적절하게 정의되고 사용되었습니다.

Copy link
Contributor

@seulgi99 seulgi99 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
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature 새로운 기능 추가 및 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ 과제 히스토리 테이블 추가
4 participants