Audit Log Retention Job
Component Detail
Infrastructure
low complexity
backend
1
Dependencies
0
Dependents
3
Entities
0
Integrations
Description
Scheduled background job that enforces the configurable log retention policy by deleting entries older than the configured threshold. Requires explicit admin approval before each run. Logs its own deletion actions to a system-level audit trail.
audit-retention-job
Responsibilities
- Read retention policy from organization settings
- Delete expired audit log entries in batches to avoid lock contention
- Require admin approval token before executing destructive operation
- Record retention run metadata (rows deleted, timestamp, approver) to system log
Interfaces
run(organizationId: string, approvalToken: string): Promise<RetentionRunResult>
preview(organizationId: string): Promise<RetentionPreview>
Relationships
Related Data Entities (3)
Data entities managed by this component