Project-Image-Uploader/backend/src/services
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
..
GroupCleanupService.js feat(backend): Implement automatic cleanup service 2025-11-08 12:23:49 +01:00
ImagePreviewService.js feat: add preview_path migration and constants 2025-10-30 20:30:56 +01:00
MigrationService.js IMP: Eigene Verzeichnisse für Uploads und Datenbank 2025-10-18 14:23:12 +02:00
SchedulerService.js feat(backend): Implement automatic cleanup service 2025-11-08 12:23:49 +01:00