Conversation
[518] mongo policy 반복/즉시/관리자 mongo db 로그 생성
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR introduces a MongoDB-backed audit logging system for policy operations. It adds a PolicyHistory entity and service to record create/update/delete events on policies and categories, updates response DTOs to include updatedAt timestamps, and integrates history logging throughout both admin and user policy services. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant PolicyService as Admin/User<br/>PolicyService
participant HistoryService as PolicyHistoryService
participant Repository as PolicyHistory<br/>Repository
participant MongoDB
Client->>PolicyService: Create/Update/Delete Policy
PolicyService->>PolicyService: Process operation
PolicyService->>HistoryService: log(tableName, event, targetId,<br/>before, after)
HistoryService->>HistoryService: calculateDetails(event, before, after)<br/>Extract user from security context
HistoryService->>Repository: save(PolicyHistory entity)
Repository->>MongoDB: persist document
MongoDB-->>Repository: acknowledged
Repository-->>HistoryService: saved entity
HistoryService-->>PolicyService: history logged
PolicyService-->>Client: response with updatedAt
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
개요
관련 BackLog
Resolves: (518)
PR 유형
PR Checklist
Summary by CodeRabbit
New Features
updatedAttimestamps for policies and categories.Tests