Skip to content

Dev#303

Merged
Misu0616 merged 2 commits into
mainfrom
dev
Mar 19, 2026
Merged

Dev#303
Misu0616 merged 2 commits into
mainfrom
dev

Conversation

@pjh813
Copy link
Copy Markdown
Contributor

@pjh813 pjh813 commented Mar 19, 2026

개요

관련 BackLog

Resolves: (Backlog Number, ...)

PR 유형

  • 새로운 기능 추가
  • 버그 수정
  • CSS 등 사용자 UI 디자인 변경
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

PR Checklist

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

Summary by CodeRabbit

  • Bug Fixes
    • Corrected calculation of personal data usage amounts and totals to ensure values are derived from the proper data display source.
    • Enhanced the accuracy of remaining data calculations for family members in shared pools through improved resolution logic.

@pjh813 pjh813 requested a review from ms-0o0 March 19, 2026 18:26
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a6016703-6dea-43b3-8029-50e3824e142d

📥 Commits

Reviewing files that changed from the base of the PR and between 1b17ef1 and 587cfeb.

📒 Files selected for processing (3)
  • src/main/java/com/pooli/data/service/impl/DataServiceImpl.java
  • src/main/java/com/pooli/family/service/FamilySharedPoolsService.java
  • src/test/java/com/pooli/data/service/impl/DataServiceImplTest.java

📝 Walkthrough

Walkthrough

This pull request modifies how personal data usage is calculated by introducing a recalculation step for remaining data through TrafficRemainingBalanceQueryService in FamilySharedPoolsService, then updates DataServiceImpl to derive personal data totals and remaining amounts from the recalculated values. Tests are updated to reflect the new expected behavior.

Changes

Cohort / File(s) Summary
Service Layer Data Recalculation
src/main/java/com/pooli/family/service/FamilySharedPoolsService.java, src/main/java/com/pooli/data/service/impl/DataServiceImpl.java
FamilySharedPoolsService now recalculates remainingData for each family member using trafficRemainingBalanceQueryService.resolveIndividualActualRemaining(). DataServiceImpl refactored to derive personalTotalAmount from basicDataAmount and personalUsedAmount from the recalculated remainingData, with conditional normalization logic.
Test Updates
src/test/java/com/pooli/data/service/impl/DataServiceImplTest.java
Test mocks updated to include remainingData(95L) and basicDataAmount(120L), with corresponding assertion changes: personalUsedAmount to 25L and personalTotalAmount to 120L.

Sequence Diagram(s)

sequenceDiagram
    participant FSP as FamilySharedPoolsService
    participant TRBQS as TrafficRemainingBalanceQueryService
    participant DSI as DataServiceImpl
    participant DB as Data Source

    FSP->>TRBQS: resolveIndividualActualRemaining(lineId, memberRemainingData)
    TRBQS->>DB: query actual remaining balance
    DB-->>TRBQS: balance data
    TRBQS-->>FSP: actualRemaining
    FSP->>FSP: set FamilyMemberDto.remainingData = actualRemaining
    
    DSI->>DSI: getDataUsage()
    DSI->>FSP: get family member display data
    FSP-->>DSI: FamilyMembersResDto with recalculated remainingData
    DSI->>DSI: personalTotalAmount = basicDataAmount
    DSI->>DSI: personalRemainingAmount = remainingData (recalculated)
    DSI->>DSI: personalUsedAmount = personalTotalAmount - personalRemainingAmount
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Dev #258: Introduces TrafficRemainingBalanceQueryService and related balance-resolution logic that is now integrated into the FamilySharedPoolsService flow.

Suggested labels

bug

Suggested reviewers

  • hyeonRS
  • Iwantcod
  • Misu0616

Poem

🐰 A hop, a skip, through data's flow,
Where remaining balances now truly know,
Their actual worth via query's grace,
Personal usage finds its rightful place!
With recalculated bounds so fine,
The numbers dance and align. ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Misu0616 Misu0616 self-requested a review March 19, 2026 18:26
Copy link
Copy Markdown
Contributor

@Misu0616 Misu0616 left a comment

Choose a reason for hiding this comment

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

reviewer가 누구인지 꼼꼼히 확인하자~!

@Misu0616 Misu0616 merged commit fff6bdd into main Mar 19, 2026
2 of 3 checks passed
This was referenced Mar 19, 2026
Merged
Merged
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