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

fix: 제출 이력이 없는 과제도 포함하도록 수정 #674

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

Sangwook02
Copy link
Member

@Sangwook02 Sangwook02 commented Aug 23, 2024

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 기존 로직은 AssignmentHistory를 기반으로 response를 만들기 때문에 제출 이력이 없는 과제들은 누락되는 일이 발생했습니다.
    AssignmentHistory가 수강신청을 하는 시점에 생성될 것이라는 생각에 선택한 방식이었으나, 최초 제출 시 생성되도록 구현되었기 때문에 로직 변경이 필요합니다.

📝 참고사항

  • service에서 StudyRepository가 사용되지 않고 있길래 제거했습니다.

📚 기타

Summary by CodeRabbit

  • 새로운 기능

    • 과제 제출 가능 목록을 개선하여 현재 상태에 따라 제출할 수 있는 과제를 더 효과적으로 필터링합니다.
    • 과제 상태를 보다 명확하게 표현하기 위해 AssignmentSubmittableDto의 기능을 확장했습니다.
    • 과제의 현재 상태가 OPEN인지 확인할 수 있는 isOpen() 메서드를 추가했습니다.
  • 버그 수정

    • 제출되지 않은 과제에 대한 새로운 조건 검사를 추가하여 예외적인 경우를 처리합니다.

@Sangwook02 Sangwook02 self-assigned this Aug 23, 2024
@Sangwook02 Sangwook02 requested a review from a team as a code owner August 23, 2024 02:28
Copy link

coderabbitai bot commented Aug 23, 2024

Walkthrough

변경 사항은 StudentStudyDetailService 클래스에서 StudyRepository 의존성을 제거하고, 과제 세부 정보를 가져오고 필터링하는 새로운 로직을 도입한 것입니다. AssignmentSubmittableDto 클래스에서는 메서드의 서명을 변경해 StudyDetail을 직접 활용하여 과제 상태를 더 명확하게 표현하고, 새로운 메서드를 추가했습니다.

Changes

파일 경로 변경 요약
src/.../StudentStudyDetailService.java StudyRepository 의존성 제거 및 getSubmittableAssignments 메서드 로직 수정
src/.../AssignmentSubmittableDto.java from 메서드에서 of 메서드로 이름 변경, 추가 인자 StudyDetail 도입, 신규 메서드 추가
src/.../Assignment.java isOpen() 메서드 추가하여 과제의 상태를 확인하는 기능 제공

Assessment against linked issues

Objective Addressed Explanation
제출 이력이 없는 과제도 제출 가능한 과제 조회에 포함되도록 수정 (#673)

🐰 새로운 과제의 길을 열어,
제출 이력 없어도 걱정 없어요!
코드의 변화와 함께 뛰어,
명확함으로 나아가는 길을 가요!
🐇✨


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

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

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

@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

List<AssignmentSubmittableDto> submittableAssignments = studyDetails.stream()
.map(studyDetail -> AssignmentSubmittableDto.of(
studyDetail,
assignmentHistories.stream()
Copy link
Member

Choose a reason for hiding this comment

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

stream 안의 stream은 가독성이 좋지 않아서, extract하면 좋을듯 합니다

Copy link
Member Author

Choose a reason for hiding this comment

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

좋아요.
다시보니 슬기님이 이미 만들어두신 private 메서드가 있었네요

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

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 986dda9 and 6645a48.

Files selected for processing (2)
  • src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (3 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentSubmittableDto.java (2 hunks)
Additional context used
Learnings (1)
src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (1)
Learnt from: Sangwook02
PR: GDSC-Hongik/gdsc-server#431
File: src/main/java/com/gdschongik/gdsc/domain/study/application/StudyService.java:50-57
Timestamp: 2024-07-07T15:32:34.451Z
Learning: Consider using Stream API for creating lists in a more concise and potentially performant manner compared to traditional for-loops.
Additional comments not posted (6)
src/main/java/com/gdschongik/gdsc/domain/study/dto/response/AssignmentSubmittableDto.java (3)

Line range hint 23-43: 메서드 시그니처 변경 및 로직 추가 확인

of 메서드의 시그니처가 변경되어 StudyDetail을 추가로 받도록 수정되었습니다. assignmentHistory가 null인 경우를 처리하는 로직이 추가되었습니다. 이러한 변경은 PR의 목표와 일치하며, 과제 제출 이력이 없는 경우를 적절히 처리합니다.


48-50: 변경 사항 없음

cancelledAssignment 메서드에는 변경 사항이 없습니다.


51-62: 새로운 메서드 추가 확인

notSubmittedAssignment 메서드는 과제 제출 이력이 없는 경우를 처리하기 위해 새롭게 추가되었습니다. 메서드 구조가 명확하며 PR의 목표와 잘 맞습니다.

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

42-49: 로직 수정 및 Stream API 사용

getSubmittableAssignments 메서드는 studyRepository 의존성을 제거하고 studyDetailRepository를 사용하여 로직을 수정했습니다. 이러한 변경은 PR의 목표와 일치하며, Stream API를 사용한 필터링이 적절하게 이루어졌습니다. 이전 학습에 따라 Stream API 사용을 권장합니다.


Line range hint 54-65: 변경 사항 없음

getStudySessions 메서드에는 변경 사항이 없습니다.


Line range hint 67-72: 변경 사항 없음

getSubmittedAssignment 메서드에는 변경 사항이 없습니다.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6645a48 and 006bf29.

Files selected for processing (2)
  • src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java (3 hunks)
  • src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyDetailService.java
Additional comments not posted (1)
src/main/java/com/gdschongik/gdsc/domain/study/domain/vo/Assignment.java (1)

80-82: isOpen 메서드가 잘 구현되었습니다.

이 메서드는 과제 상태가 OPEN인지 확인하는 간단한 논리를 올바르게 구현하고 있습니다.

@Sangwook02 Sangwook02 merged commit 05017d6 into develop Aug 23, 2024
1 check passed
@Sangwook02 Sangwook02 deleted the fix/673-include-not-submitted-assignments branch August 24, 2024 07:01
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.

🐛 제출 이력이 없는 과제도 제출 가능한 과제 조회에 포함되도록 수정
3 participants