Skip to content

[Feat/update signup response] - 회원가입에 환영알(Egg) 정보 추가#95

Merged
ekgns33 merged 8 commits intomainfrom
feat/update-signup-response
May 19, 2025
Merged

[Feat/update signup response] - 회원가입에 환영알(Egg) 정보 추가#95
ekgns33 merged 8 commits intomainfrom
feat/update-signup-response

Conversation

@ekgns33
Copy link
Contributor

@ekgns33 ekgns33 commented May 18, 2025

작업내역

  • 회원가입 후 지급받는 알정보 추가
  • UserRegisterService에 있던 알 지급 로직을 Usecase 레이어로 올림.
    • 각 서비스는 자기 역할만하자!!

Summary by CodeRabbit

  • New Features

    • Users now receive a greeting egg upon successful registration. The registration response includes the egg's name, type, and image URL.
  • Bug Fixes

    • Improved test coverage to ensure greeting eggs are granted correctly during user registration.
  • Tests

    • Added and updated test fixtures and test cases for greeting egg functionality and user registration scenarios.
  • Refactor

    • Streamlined user registration logic by relocating egg granting responsibility and updating related service dependencies.
    • Enhanced test utilities for easier creation of user and egg test data.

@ekgns33 ekgns33 self-assigned this May 18, 2025
@ekgns33 ekgns33 added enhancement New feature or request 🚀 feature 🚀 labels May 18, 2025
@ekgns33 ekgns33 requested a review from Copilot May 18, 2025 12:04
@coderabbitai
Copy link

coderabbitai bot commented May 18, 2025

Walkthrough

The changes introduce a new feature that grants a "greeting egg" to users upon registration. This involves updating the user signup service and response DTO to include egg information, modifying the egg grant service to return the granted egg, and updating related tests and fixtures to support and verify the new behavior. Unnecessary dependencies on egg granting are removed from unrelated services.

Changes

File(s) Change Summary
src/main/java/org/runimo/runimo/auth/service/SignUpUsecaseImpl.java Integrated egg granting into user registration; added dependency on EggGrantService. The register method now grants an egg and includes it in the signup response.
src/main/java/org/runimo/runimo/auth/service/dto/SignupUserResponse.java Extended response to include greeting egg name, type, and image URL; constructor updated to accept and extract data from an Egg object.
src/main/java/org/runimo/runimo/rewards/service/eggs/EggGrantService.java Changed grantGreetingEggToUser to return an Egg (or Egg.EMPTY) instead of void, reflecting the result of the grant operation.
src/main/java/org/runimo/runimo/user/service/UserRegisterService.java Removed dependency on EggGrantService and related egg granting logic from user registration.
src/test/java/org/runimo/runimo/auth/service/SignUpUsecaseTest.java Added mock for EggGrantService and a new test to verify egg granting during signup; updated imports and assertions.
src/test/java/org/runimo/runimo/item/EggFixtures.java New test fixture class for easily creating Egg and EggType objects with default or custom attributes.
src/test/java/org/runimo/runimo/user/UserFixtures.java Added constants for test user nickname, image URL, and a test TokenPair; refactored usage in fixture methods.
src/test/java/org/runimo/runimo/user/api/UserItemAcceptanceTest.java Updated mocked signup response to include greeting egg fields for testing.
src/test/java/org/runimo/runimo/user/service/usecases/UserRegisterServiceTest.java Removed all mocking and verification of EggGrantService as it's no longer used in user registration.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant SignUpUsecaseImpl
    participant UserRegisterService
    participant EggGrantService
    participant TokenService

    Client->>SignUpUsecaseImpl: register(signUpCommand)
    SignUpUsecaseImpl->>UserRegisterService: registerUser(command)
    UserRegisterService-->>SignUpUsecaseImpl: savedUser
    SignUpUsecaseImpl->>EggGrantService: grantGreetingEggToUser(savedUser)
    EggGrantService-->>SignUpUsecaseImpl: greetingEgg
    SignUpUsecaseImpl->>TokenService: createTokenPair(savedUser)
    TokenService-->>SignUpUsecaseImpl: tokenPair
    SignUpUsecaseImpl-->>Client: SignupUserResponse(user, tokenPair, greetingEgg)
Loading

Poem

In the meadow where new users hop,
A greeting egg is their very first stop.
With code and care, the feature’s now done—
Each signup rewarded, a prize for each one!
Test bunnies cheer, their fixtures in tow,
For every new friend, an egg’s golden glow.
🥚✨

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Free
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 64fc033 and 66dbd67.

📒 Files selected for processing (1)
  • src/test/java/org/runimo/runimo/user/UserFixtures.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/test/java/org/runimo/runimo/user/UserFixtures.java

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Join our Discord community for assistance with any issues or questions.

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 sequence diagram to generate a sequence diagram of the changes in 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.

@ekgns33 ekgns33 requested review from jeeheaG and removed request for Copilot May 18, 2025 12:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds welcome egg information to the signup response and moves the egg granting logic from the UserRegisterService to the usecase layer.

  • Removed egg-related logic from UserRegisterService and corresponding tests.
  • Updated SignupUserResponse to include egg information.
  • Added EggFixtures and tests for verifying the greeting egg award.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/java/org/runimo/runimo/user/service/usecases/UserRegisterServiceTest.java Removed eggGrantService usage from unit tests as the logic was moved to the usecase layer.
src/test/java/org/runimo/runimo/user/api/UserItemAcceptanceTest.java Updated test construction to include egg parameters.
src/test/java/org/runimo/runimo/user/UserFixtures.java Updated user fixture constants; potential inconsistency in imgUrl value for getUserWithId.
src/test/java/org/runimo/runimo/item/EggFixtures.java New fixture file for egg test data.
src/test/java/org/runimo/runimo/auth/service/SignUpUsecaseTest.java Added test for awarding greeting egg on signup.
src/main/java/org/runimo/runimo/user/service/UserRegisterService.java Removed outdated egg granting call.
src/main/java/org/runimo/runimo/rewards/service/eggs/EggGrantService.java Changed the method signature to return the granted egg.
src/main/java/org/runimo/runimo/auth/service/dto/SignupUserResponse.java Updated response DTO to include greeting egg fields.
src/main/java/org/runimo/runimo/auth/service/SignUpUsecaseImpl.java Updated usecase to obtain and return the greeting egg in the signup response.

Copy link
Contributor

@jeeheaG jeeheaG left a comment

Choose a reason for hiding this comment

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

역할 구분 좋습니다~~~
수고하셨습니다!

@ekgns33 ekgns33 merged commit 2b92763 into main May 19, 2025
3 checks passed
@ekgns33 ekgns33 deleted the feat/update-signup-response branch May 19, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request 🚀 feature 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants