snooze vor expired, contracts, display snoozed contracts if an item is missing, un snooze implemented, fixed invoice upload bug
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user