feat: add Buchhaltung data reset (Transaktionen, Konten, Bankkonten) to admin DataManagementTab

This commit is contained in:
Matthias Hochmeister
2026-03-30 11:16:57 +02:00
parent 333b94f64e
commit 5f25d644f4
3 changed files with 55 additions and 5 deletions

View File

@@ -241,6 +241,9 @@ const CLEANUP_TARGETS: Record<CleanupTarget, (days: number, confirm: boolean) =>
router.delete('/cleanup/reset-bestellungen', authenticate, requirePermission('admin:write'), (req, res) => { req.params.resetTarget = 'reset-bestellungen'; return resetHandler(req, res); });
router.delete('/cleanup/reset-ausruestung-anfragen', authenticate, requirePermission('admin:write'), (req, res) => { req.params.resetTarget = 'reset-ausruestung-anfragen'; return resetHandler(req, res); });
router.delete('/cleanup/reset-issues', authenticate, requirePermission('admin:write'), (req, res) => { req.params.resetTarget = 'reset-issues'; return resetHandler(req, res); });
router.delete('/cleanup/reset-buchhaltung-transaktionen', authenticate, requirePermission('admin:write'), (req, res) => { req.params.resetTarget = 'reset-buchhaltung-transaktionen'; return resetHandler(req, res); });
router.delete('/cleanup/reset-buchhaltung-konten', authenticate, requirePermission('admin:write'), (req, res) => { req.params.resetTarget = 'reset-buchhaltung-konten'; return resetHandler(req, res); });
router.delete('/cleanup/reset-buchhaltung-bankkonten', authenticate, requirePermission('admin:write'), (req, res) => { req.params.resetTarget = 'reset-buchhaltung-bankkonten'; return resetHandler(req, res); });
router.delete('/cleanup/reset-checklist-history', authenticate, requirePermission('admin:write'), (req, res) => { req.params.resetTarget = 'reset-checklist-history'; return resetHandler(req, res); });
router.delete('/cleanup/issues-all', authenticate, requirePermission('admin:write'), (req, res) => { req.params.resetTarget = 'issues-all'; return resetHandler(req, res); });
@@ -277,11 +280,14 @@ router.delete(
// ---------------------------------------------------------------------------
const RESET_TARGETS: Record<string, (confirm: boolean) => Promise<{ count: number; deleted: boolean }>> = {
'reset-bestellungen': (c) => cleanupService.resetBestellungenSequence(c),
'reset-ausruestung-anfragen': (c) => cleanupService.resetAusruestungAnfragenSequence(c),
'reset-issues': (c) => cleanupService.resetIssuesSequence(c),
'issues-all': (c) => cleanupService.resetIssuesSequence(c),
'reset-checklist-history': (c) => cleanupService.resetChecklistHistory(c),
'reset-bestellungen': (c) => cleanupService.resetBestellungenSequence(c),
'reset-ausruestung-anfragen': (c) => cleanupService.resetAusruestungAnfragenSequence(c),
'reset-issues': (c) => cleanupService.resetIssuesSequence(c),
'issues-all': (c) => cleanupService.resetIssuesSequence(c),
'reset-checklist-history': (c) => cleanupService.resetChecklistHistory(c),
'reset-buchhaltung-transaktionen': (c) => cleanupService.resetBuchhaltungTransaktionen(c),
'reset-buchhaltung-konten': (c) => cleanupService.resetBuchhaltungKonten(c),
'reset-buchhaltung-bankkonten': (c) => cleanupService.resetBuchhaltungBankkonten(c),
};
const resetHandler = async (req: Request, res: Response): Promise<void> => {