Conversation
WalkthroughPillIntakeRecordRepository에 intakeDate 기반 조회와 Pill 기준 삭제 메서드가 추가되었고, PillService에 FCM 기반 복약 알림 스케줄러와 알림 전송 로직이 도입되었습니다. 또한 Pill 삭제 시 관련 PillIntakeRecord 일괄 삭제가 연계되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Scheduler
participant PillService
participant PillRepository as PillRepo
participant IntakeRepo as PillIntakeRecordRepo
participant TokenRepo as UserFcmTokenRepo
participant FCM as FirebaseMessaging
Scheduler->>PillService: checkAndSendMedicationAlarms()
activate PillService
PillService->>PillRepo: 조회: 활성/사용자별 Pill
PillService->>IntakeRepo: 오늘자 복용기록 조회(필요 시)
PillService->>PillService: 요일/시간 기준 미복용 Pill 필터링
loop 각 대상 Pill
PillService->>TokenRepo: 소유자 FCM 토큰 조회
alt 토큰 존재
PillService->>FCM: Message 전송(Android/iOS 설정 포함)
FCM-->>PillService: 전송 결과/에러
note over PillService,FCM: 개별 실패는 캐치하고 다음 Pill 진행
else 토큰 없음
Note over PillService: 전송 스킵
end
end
deactivate PillService
sequenceDiagram
autonumber
actor Client
participant PillService
participant IntakeRepo as PillIntakeRecordRepo
participant PillRepo
Client->>PillService: deletePill(pillId)
activate PillService
PillService->>IntakeRepo: deleteByPill(Pill)
IntakeRepo-->>PillService: 삭제 완료
PillService->>PillRepo: delete(Pill)
PillRepo-->>PillService: 삭제 완료
deactivate PillService
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Free 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
Note 🎁 Summarized by CodeRabbit FreeYour 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit