added invoices and status in cockpit, created info button for contract status types

This commit is contained in:
2026-02-08 01:18:12 +01:00
parent 89d528bb77
commit ad2b8ea5b6
45 changed files with 4543 additions and 863 deletions
+25 -4
View File
@@ -596,12 +596,18 @@ model ContractTaskSubtask {
// ==================== ENERGY CONTRACT DETAILS ====================
enum InvoiceType {
INTERIM // Zwischenrechnung
FINAL // Schlussrechnung
NOT_AVAILABLE // Rechnung nicht mehr zu bekommen
}
model EnergyContractDetails {
id Int @id @default(autoincrement())
contractId Int @unique
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
id Int @id @default(autoincrement())
contractId Int @unique
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
meterId Int?
meter Meter? @relation(fields: [meterId], references: [id])
meter Meter? @relation(fields: [meterId], references: [id])
maloId String? // Marktlokations-ID
annualConsumption Float? // kWh für Strom, m³ für Gas
annualConsumptionKwh Float? // kWh für Gas (zusätzlich zu m³)
@@ -610,6 +616,21 @@ model EnergyContractDetails {
bonus Float?
previousProviderName String?
previousCustomerNumber String?
invoices Invoice[] // Rechnungen
}
model Invoice {
id Int @id @default(autoincrement())
energyContractDetailsId Int
energyContractDetails EnergyContractDetails @relation(fields: [energyContractDetailsId], references: [id], onDelete: Cascade)
invoiceDate DateTime
invoiceType InvoiceType
documentPath String? // Pflicht, außer bei NOT_AVAILABLE
notes String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([energyContractDetailsId])
}
// ==================== INTERNET CONTRACT DETAILS ====================