added contract history

This commit is contained in:
2026-02-08 19:24:37 +01:00
parent ee4f1aacdd
commit e348e86c60
33 changed files with 3200 additions and 743 deletions
+14
View File
@@ -566,11 +566,25 @@ model Contract {
tasks ContractTask[]
assignedEmails CachedEmail[] // Zugeordnete E-Mails aus dem E-Mail-Client
historyEntries ContractHistoryEntry[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ==================== CONTRACT HISTORY ====================
model ContractHistoryEntry {
id Int @id @default(autoincrement())
contractId Int
contract Contract @relation(fields: [contractId], references: [id], onDelete: Cascade)
title String // Kurzbeschreibung (z.B. "Folgevertrag erstellt", "kWh auf 18000 erhöht")
description String? @db.Text // Längere Beschreibung (optional)
isAutomatic Boolean @default(false) // true = automatisch erstellt, false = manuell
createdBy String // E-Mail des Erstellers
createdAt DateTime @default(now())
}
// ==================== CONTRACT TASKS ====================
enum ContractTaskStatus {