snooze vor expired, contracts, display snoozed contracts if an item is missing, un snooze implemented, fixed invoice upload bug

This commit is contained in:
2026-02-08 13:08:58 +01:00
parent 839bb40f5e
commit 2ab2bb7562
39 changed files with 1369 additions and 800 deletions
+7 -5
View File
@@ -39,13 +39,15 @@ export async function getInvoice(energyContractDetailsId: number, invoiceId: num
/**
* Neue Rechnung hinzufügen
*
* Hinweis: Die Validierung ob ein Dokument vorhanden ist, erfolgt NICHT hier,
* da der typische Flow so aussieht:
* 1. Invoice erstellen (ohne Dokument) → Invoice-ID zurückbekommen
* 2. Dokument hochladen mit der Invoice-ID
*
* Die Validierung ob alle Rechnungen Dokumente haben, erfolgt im Cockpit.
*/
export async function addInvoice(energyContractDetailsId: number, data: CreateInvoiceData) {
// Validierung: documentPath ist Pflicht, außer bei NOT_AVAILABLE
if (data.invoiceType !== 'NOT_AVAILABLE' && !data.documentPath) {
throw new Error('Dokument ist Pflicht (außer bei Typ "Nicht verfügbar")');
}
// Prüfen ob EnergyContractDetails existiert
const energyDetails = await prisma.energyContractDetails.findUnique({
where: { id: energyContractDetailsId },