Project-Image-Uploader/docs
matthias.lotz 939cf22163 feat(backend): Implement automatic cleanup service
Phase 2 Complete - Backend Core Logic

New Components:
- DeletionLogRepository: CRUD for deletion audit trail
- GroupCleanupService: Core cleanup logic
  - findGroupsForDeletion() - finds unapproved groups older than 7 days
  - deleteGroupCompletely() - DB + file deletion
  - deletePhysicalFiles() - removes images & previews
  - logDeletion() - creates audit log entry
  - getDaysUntilDeletion() - calculates remaining days
  - performScheduledCleanup() - main cleanup orchestrator
- SchedulerService: Cron job management
  - Daily cleanup at 10:00 AM (Europe/Berlin)
  - Manual trigger for development

GroupRepository Extensions:
- findUnapprovedGroupsOlderThan(days)
- deleteGroupCompletely(groupId)
- getGroupStatistics(groupId)

Dependencies:
- node-cron ^3.0.3

Integration:
- Scheduler auto-starts with server (server.js)
- Comprehensive logging for all operations

Tasks completed:  2.3,  2.4,  2.5
2025-11-08 12:23:49 +01:00
..
FEATURE_PLAN-delete-unproved-groups.md feat(backend): Implement automatic cleanup service 2025-11-08 12:23:49 +01:00
FEATURE_PLAN-image-description.md docs: Update documentation for image descriptions feature 2025-11-07 18:39:48 +01:00
FEATURE_PLAN-preview-images.md docs: add feature plan for preview images 2025-10-29 23:34:08 +01:00
FEATURE_PLAN-reordering.md docs: update feature plan with completion status 2025-11-03 21:22:15 +01:00
REORDERING_IMPLEMENTATION_REPORT.md docs: update README.md with new reordering features 2025-11-03 21:24:29 +01:00
UPGRADE_PLAN-upgrade-deps-react-node-20251028.md docs: complete upgrade documentation with CHANGELOG, smoke tests, and actual timelines 2025-10-29 23:10:21 +01:00