Skip to content

Dev#313

Merged
pjh813 merged 3 commits into
mainfrom
dev
Mar 23, 2026
Merged

Dev#313
pjh813 merged 3 commits into
mainfrom
dev

Conversation

@ms-0o0
Copy link
Copy Markdown
Contributor

@ms-0o0 ms-0o0 commented Mar 23, 2026

개요

관련 BackLog

Resolves: (Backlog Number, ...)

PR 유형

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

PR Checklist

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

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved accuracy of family shared pool remaining and usage amount calculations for more precise display.
    • Updated data privacy settings logic to require both individual privacy permissions and family sharing configuration for data visibility.
    • Enhanced data amount normalization to properly handle edge cases and negative values.

@ms-0o0 ms-0o0 requested review from hyeonRS and pjh813 March 23, 2026 00:42
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 23, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ab14a24-36f0-4034-9c5a-db6dd4234f54

📥 Commits

Reviewing files that changed from the base of the PR and between d08b5c8 and d3cb211.

📒 Files selected for processing (7)
  • src/main/java/com/pooli/data/service/impl/DataServiceImpl.java
  • src/main/java/com/pooli/family/service/FamilySharedPoolsService.java
  • src/main/java/com/pooli/family/service/impl/FamilyServiceImpl.java
  • src/test/java/com/pooli/data/service/impl/DataServiceImplTest.java
  • src/test/java/com/pooli/family/service/FamilySharedPoolsServiceTest.java
  • src/test/java/com/pooli/family/service/impl/FamilyServiceImplTest.java
  • src/test/java/com/pooli/traffic/acceptance/TrafficFlowLocalAcceptanceTest.java

📝 Walkthrough

Walkthrough

Changes shift family shared pool calculations from monthly-based to actual/real-time semantics. Removes monthly-adjustment logic from DataServiceImpl, updates FamilySharedPoolsService to reconcile member usage with actual values, replaces public method naming (monthly→actual), and updates corresponding test expectations and acceptance test assertions.

Changes

Cohort / File(s) Summary
Data & Family Service Logic
src/main/java/com/pooli/data/service/impl/DataServiceImpl.java, src/main/java/com/pooli/family/service/impl/FamilyServiceImpl.java
Removed monthly-usage adjustment helpers and normalized value handling; switched from monthly-based to actual shared-pool display resolution; simplified public-flag calculation to require both permissionEnabled and familyLine.isPublic.
Family Shared Pools Service
src/main/java/com/pooli/family/service/FamilySharedPoolsService.java
Replaced contribution history retrieval from mapper to transfer-log repository with timestamp sorting; added actual shared usage reconciliation via trafficRemainingBalanceQueryService; renamed/replaced public methods (monthly→actual semantics: resolveFamilyMonthlySharedPoolRemainingresolveFamilyActualSharedRemaining, etc.); updated display logic to use actual remaining/used values.
Unit Tests
src/test/java/com/pooli/data/service/impl/DataServiceImplTest.java, src/test/java/com/pooli/family/service/.../FamilyServiceImplTest.java, src/test/java/com/pooli/family/service/FamilySharedPoolsServiceTest.java
Updated test cases to reflect actual-based calculations; replaced mapper/method stubs with new repository and service call stubs; adjusted assertions for shared-pool remaining and display values; removed obsolete test cases; changed contribution history precision from "DAY" to "EVENT".
Acceptance Test
src/test/java/com/pooli/traffic/acceptance/TrafficFlowLocalAcceptanceTest.java
Updated expected outcome for exhausted-pool scenario: changed from SUCCESS to PARTIAL_SUCCESS with revised remaining and deducted amounts.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant DataService as DataServiceImpl
    participant SharedPoolService as FamilySharedPoolsService
    participant TrafficService as TrafficRemainingBalanceQueryService
    participant DB as Repository/Mapper

    Client->>DataService: getDataUsage(lineId)
    DataService->>SharedPoolService: resolveFamilyMemberActualDisplay(lineId)
    SharedPoolService->>TrafficService: resolveSharedActualRemaining(familyId)
    TrafficService->>DB: Query actual remaining balance
    DB-->>TrafficService: actual remaining value
    TrafficService-->>SharedPoolService: actual remaining
    SharedPoolService->>DB: loadAdjustedFamilyMonthlySharedUsageByLine(...)
    DB-->>SharedPoolService: member monthly usage list
    SharedPoolService->>SharedPoolService: reconcileMemberActualSharedUsage(...)
    Note over SharedPoolService: Reconcile per-member usage<br/>to match target used amount
    SharedPoolService-->>DataService: display remaining amount
    DataService-->>Client: data usage response
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • Dev #258 — Comprehensive refactoring of family shared-pool remaining/used resolution from monthly-based to actual/real-time values with corresponding updates to TrafficRemainingBalanceQueryService integration.
  • Dev #304 — Directly replaces shared-pool contribution history retrieval from mapper-based to transfer-log repository with timestamp sorting.
  • Dev #300 — Modifies family shared-pool display and data-usage logic in the same service classes, introducing month-aggregated "monthly" APIs while this PR shifts to "actual" semantics.

Suggested labels

bug, priority:high

Suggested reviewers

  • hyeonRS
  • pjh813

Poem

🐰 The monthly chains have fallen away,
Actual values now hold sway!
Pools reconcile with real-time grace,
While shared semantics find their place. 📊✨

✨ 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

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.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

@pjh813 pjh813 merged commit 766f285 into main Mar 23, 2026
2 of 3 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Mar 23, 2026
Merged
13 tasks
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