Skip to content

[Feat/love entity]#8

Merged
ekgns33 merged 7 commits intomainfrom
feat/love_entity
Mar 28, 2025
Merged

[Feat/love entity]#8
ekgns33 merged 7 commits intomainfrom
feat/love_entity

Conversation

@ekgns33
Copy link
Contributor

@ekgns33 ekgns33 commented Mar 28, 2025

작업 내역

애정 포인트 기능 개발

  • item을 추상화하려던 초기 설계와 다르게 1 : 1 관계의 테이블로 구성
user  ---- user_love_point
id              id
                user_id
                amount
  • 달리기 기록 후 보상 요청 시 달린 거리에 비례하여 지급할 애정 계산 > 1km당 1개

테스트

  • 테스트 코드 작성
  • 1km 미만일때 미지급 확인
  • 1km 이상일때 지급 확인

@ekgns33 ekgns33 requested a review from Copilot March 28, 2025 10:52
@ekgns33 ekgns33 self-assigned this Mar 28, 2025
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 introduces the love point feature, which rewards users with love points based on their running distance. Key changes include adding a new love point domain and repository, integrating love point processing into user registration and rewards flows, and updating tests to validate proper love point awarding.

Reviewed Changes

Copilot reviewed 16 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/test/java/org/runimo/runimo/user/api/UserItemAcceptanceTest.java Added SQL setup for love point related tests in user API acceptance.
src/test/java/org/runimo/runimo/rewards/service/RewardServiceTest.java Injected and mocked love point grant service for reward testing.
src/test/java/org/runimo/runimo/rewards/api/RewardAcceptanceTest.java Added acceptance tests to verify love point reward behavior.
src/test/java/org/runimo/runimo/CleanUpUtil.java Updated cleanup to include the love point table.
src/main/java/org/runimo/runimo/user/service/usecases/UserRegisterService.java Integrated creation of love point during user registration.
src/main/java/org/runimo/runimo/user/service/UserFinder.java Added love point finding logic.
src/main/java/org/runimo/runimo/user/service/UserCreator.java Added method to create a love point instance upon user creation.
src/main/java/org/runimo/runimo/user/service/LovePointProcessor.java New processor to update love points with pessimistic locking.
src/main/java/org/runimo/runimo/user/repository/LovePointRepository.java Created repository for love point persistence with locking hints.
src/main/java/org/runimo/runimo/user/domain/LovePoint.java Domain class for love points including add/subtract methods.
src/main/java/org/runimo/runimo/rewards/service/lovepoint/LoveGrantService.java Implements love point granting based on running distance.
src/main/java/org/runimo/runimo/rewards/service/dtos/RewardResponse.java Extended reward response to include love point amount.
src/main/java/org/runimo/runimo/rewards/service/RewardService.java Integrated love point awarding into the reward claiming logic.
src/main/java/org/runimo/runimo/item/domain/Egg.java Added discriminator value for Egg.
src/main/java/org/runimo/runimo/common/scale/Distance.java Added arithmetic for distance division which is used to calculate rewards.
src/main/java/org/runimo/runimo/common/GlobalConsts.java Defined distance unit constant used in love point calculations.
Files not reviewed (3)
  • src/main/resources/sql/schema.sql: Language not supported
  • src/test/resources/sql/schema.sql: Language not supported
  • src/test/resources/sql/user_item_test_data.sql: Language not supported

@ekgns33 ekgns33 merged commit 1a147ab into main Mar 28, 2025
1 check passed
@ekgns33 ekgns33 deleted the feat/love_entity branch March 28, 2025 11:05
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.

2 participants