From 4e42d4077a3c36e435f33bd8b95ce970959d0200 Mon Sep 17 00:00:00 2001 From: Matthias Hochmeister Date: Mon, 30 Mar 2026 11:25:48 +0200 Subject: [PATCH] fix: hard-delete konten instead of soft-deactivate, convert kontonummer to INTEGER with arithmetic sub-account derivation --- backend/src/services/buchhaltung.service.ts | 3 +-- frontend/src/pages/Buchhaltung.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/src/services/buchhaltung.service.ts b/backend/src/services/buchhaltung.service.ts index aa4f151..1a62b7c 100644 --- a/backend/src/services/buchhaltung.service.ts +++ b/backend/src/services/buchhaltung.service.ts @@ -415,8 +415,7 @@ async function updateKonto( async function deleteKonto(id: number) { try { - // Soft delete - await pool.query(`UPDATE buchhaltung_konten SET aktiv = FALSE WHERE id = $1`, [id]); + await pool.query(`DELETE FROM buchhaltung_konten WHERE id = $1`, [id]); } catch (error) { logger.error('BuchhaltungService.deleteKonto failed', { error, id }); throw new Error('Konto konnte nicht gelöscht werden'); diff --git a/frontend/src/pages/Buchhaltung.tsx b/frontend/src/pages/Buchhaltung.tsx index 3bc4c40..14afe70 100644 --- a/frontend/src/pages/Buchhaltung.tsx +++ b/frontend/src/pages/Buchhaltung.tsx @@ -1002,7 +1002,7 @@ function KontenTab({ haushaltsjahre, selectedJahrId, onJahrChange }: { }); const deleteKontoMut = useMutation({ mutationFn: buchhaltungApi.deleteKonto, - onSuccess: () => { qc.invalidateQueries({ queryKey: ['buchhaltung-konten'] }); qc.invalidateQueries({ queryKey: ['kontenTree'] }); showSuccess('Konto deaktiviert'); }, + onSuccess: () => { qc.invalidateQueries({ queryKey: ['buchhaltung-konten'] }); qc.invalidateQueries({ queryKey: ['kontenTree'] }); showSuccess('Konto gelöscht'); }, onError: () => showError('Löschen fehlgeschlagen'), });