fix: Implement tiered backup retention classification (refs #6)
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

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>
This commit is contained in:
Eric Gullickson
2026-01-10 21:53:43 -06:00
parent 82a543b250
commit 19ece562ed
12 changed files with 681 additions and 114 deletions

View File

@@ -386,6 +386,7 @@ export const AdminBackupPage: React.FC = () => {
<TableCell>Size</TableCell>
<TableCell>Status</TableCell>
<TableCell>Created</TableCell>
<TableCell>Expires</TableCell>
<TableCell align="right">Actions</TableCell>
</TableRow>
</TableHead>
@@ -415,6 +416,9 @@ export const AdminBackupPage: React.FC = () => {
/>
</TableCell>
<TableCell>{formatDate(backup.startedAt)}</TableCell>
<TableCell>
{backup.expiresAt ? formatDate(backup.expiresAt) : '-'}
</TableCell>
<TableCell align="right">
<IconButton
size="small"