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: 멘토 권한 부여 로직 추가 #712

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

Sangwook02
Copy link
Member

@Sangwook02 Sangwook02 commented Aug 29, 2024

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 스터디 개설시 멘토 권한 부여 로직이 빠져있어서 추가했습니다.

📝 참고사항

📚 기타

  • RecruitmentConstant의 academicYear와 semesterType을 여기저기에서 가져다 쓰고 있어요. 별도 상수 클래스로 분리해야 할 것 같습니다! 이슈 만들어둘게요~

Summary by CodeRabbit

  • 새로운 기능
    • 스터디 생성 시 멘토가 명시적으로 할당되는 기능 추가.
    • 멘토의 상태가 데이터베이스에 저장되어 스터디 생성의 데이터 무결성 향상.

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

coderabbitai bot commented Aug 29, 2024

Walkthrough

AdminStudyService 클래스의 createStudyAndStudyDetail 메서드에 멘토 권한 부여 로직이 추가되었습니다. 이제 이 메서드는 멘토의 Member 객체를 가져와 assignToMentor() 메서드를 호출하여 멘토를 명시적으로 할당합니다. 또한, 멘토의 상태 변경 사항을 데이터베이스에 저장하기 위해 memberRepository.save(mentor)가 호출됩니다. 새로운 테스트 클래스도 추가되어 멘토 할당 로직의 검증이 이루어집니다.

Changes

파일 경로 변경 요약
src/main/java/com/gdschongik/gdsc/domain/study/application/AdminStudyService.java 멘토 할당 로직 구현 및 멘토 상태 저장 추가
src/test/java/com/gdschongik/gdsc/domain/study/application/AdminStudyServiceTest.java 멘토 할당 로직 검증을 위한 테스트 클래스 추가

Assessment against linked issues

Objective Addressed Explanation
스터디 개설시 멘토 권한 부여 로직 추가 (#711)

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

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 8b779f8 and 980655e.

Files selected for processing (1)
  • src/main/java/com/gdschongik/gdsc/domain/study/application/AdminStudyService.java (1 hunks)
Additional comments not posted (3)
src/main/java/com/gdschongik/gdsc/domain/study/application/AdminStudyService.java (3)

33-33: 멘토 객체 가져오기

getMemberById 메서드를 호출하여 멘토의 Member 객체를 가져옵니다. 이 부분은 멘토 권한 부여 로직의 첫 단계로 적절합니다.

코드 변경 사항이 승인되었습니다.


34-34: 멘토 권한 부여

mentor.assignToMentor() 메서드를 호출하여 멘토에게 명시적으로 권한을 부여합니다. 이 부분은 멘토 권한 부여 로직의 핵심입니다.

코드 변경 사항이 승인되었습니다.


35-35: 멘토 상태 저장

memberRepository.save(mentor)를 호출하여 멘토의 상태 변경 사항을 데이터베이스에 저장합니다. 이 부분은 데이터의 무결성을 보장합니다.

코드 변경 사항이 승인되었습니다.

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 980655e and df960ed.

Files selected for processing (1)
  • src/test/java/com/gdschongik/gdsc/domain/study/application/AdminStudyServiceTest.java (1 hunks)
Additional comments not posted (5)
src/test/java/com/gdschongik/gdsc/domain/study/application/AdminStudyServiceTest.java (5)

1-2: 패키지 선언 확인

패키지 선언이 올바르게 되어 있습니다.

패키지 선언은 적절합니다.


3-13: 적절한 임포트

임포트된 클래스와 상수들이 테스트에 필요합니다.

임포트는 적절합니다.


14-18: 클래스 설정 확인

클래스 설정이 적절하며, IntegrationTest를 확장하고 AdminStudyService를 주입받습니다.

클래스 설정은 적절합니다.


19-21: 중첩 클래스 설정 확인

중첩 클래스 설정이 적절하며, 관련된 테스트를 조직화하는 데 유용합니다.

중첩 클래스 설정은 적절합니다.


22-46: 테스트 메서드 확인

테스트 메서드가 잘 구조화되어 있으며, 멘토 할당 로직을 검증합니다.

테스트 메서드는 적절합니다.

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

@Sangwook02 Sangwook02 merged commit 0eb992e into develop Aug 29, 2024
1 check passed
@Sangwook02 Sangwook02 deleted the feature/711-assign-mentor-role branch August 29, 2024 03:27
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.

✨ 스터디 개설시 멘토 권한 부여 로직 추가
3 participants