Files
motovaultpro/backend/src/features/backup/CLAUDE.md
Eric Gullickson 19ece562ed
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 6m15s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 28s
Deploy to Staging / Verify Staging (pull_request) Successful in 7s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
fix: Implement tiered backup retention classification (refs #6)
Replace per-schedule count-based retention with unified tiered classification.
Backups are now classified by timestamp into categories (hourly/daily/weekly/monthly)
and are only deleted when they exceed ALL applicable category quotas.

Changes:
- Add backup-classification.service.ts for timestamp-based classification
- Rewrite backup-retention.service.ts with tiered logic
- Add categories and expires_at columns to backup_history
- Add Expires column to desktop and mobile backup UI
- Add unit tests for classification logic (22 tests)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 21:53:43 -06:00

1.2 KiB

backup/

Complete backup and restore system with tiered retention.

Files

File What When to read
README.md Feature documentation Understanding backup architecture

Subdirectories

Directory What When to read
api/ HTTP endpoints, validation API changes
domain/ Business logic, services Core backup/retention logic
data/ Repository, database queries Database operations
jobs/ Scheduled job handlers Cron job modifications
migrations/ Database schema Schema changes
tests/ Unit and integration tests Adding or modifying tests

Key Files

File What When to read
domain/backup.types.ts Types, constants, TIERED_RETENTION Type definitions
domain/backup.service.ts Core backup operations Creating/managing backups
domain/backup-classification.service.ts Tiered retention classification Category/expiration logic
domain/backup-retention.service.ts Retention enforcement Deletion logic
data/backup.repository.ts Database queries Data access patterns