refactor(family):가족공유 api 조회 redis+db로 재구성#253
Conversation
|
정책 위반: main에는 dev에서만 PR이 가능합니다. 이 PR은 자동으로 닫습니다. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR introduces Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant FamilyService as Family Service
participant BalanceService as TrafficRemainingBalanceQueryService
participant Redis as Redis Cache
participant Database as Database
Client->>FamilyService: getFamilyMembers() / getSharedPoolStatus()
FamilyService->>Database: Fetch family/member data<br/>(dbRemaining value)
Database-->>FamilyService: Return family header & members
FamilyService->>BalanceService: resolveSharedActualRemaining<br/>(familyId, dbRemaining)
BalanceService->>BalanceService: Normalize dbRemaining
BalanceService->>Redis: Read balance key<br/>(owner, yearMonth)
Redis-->>BalanceService: Redis balance value<br/>(or null if miss)
BalanceService->>BalanceService: safeAdd(normalized, redisValue)<br/>with overflow protection
BalanceService-->>FamilyService: Actual remaining balance
FamilyService->>FamilyService: Enrich members with<br/>actual remaining data
FamilyService->>FamilyService: Apply shared limit<br/>clamping if needed
FamilyService-->>Client: Return response with<br/>actual remaining amounts
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.Add a .trivyignore file to your project to customize which findings Trivy reports. |
|
정책 위반: main에는 dev에서만 PR이 가능합니다. 이 PR은 자동으로 닫습니다. |
개요
가족 공유 api 조회 로직 db -> redis +db로 변경
관련 BackLog
Resolves: (Backlog Number, ...)
PR 유형
PR Checklist
Summary by CodeRabbit
Release Notes
New Features
Updates