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 -3
View File
File diff suppressed because one or more lines are too long
+11
View File
@@ -443,6 +443,16 @@ exports.Prisma.ContractScalarFieldEnum = {
updatedAt: 'updatedAt'
};
exports.Prisma.ContractHistoryEntryScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
title: 'title',
description: 'description',
isAutomatic: 'isAutomatic',
createdBy: 'createdBy',
createdAt: 'createdAt'
};
exports.Prisma.ContractTaskScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
@@ -676,6 +686,7 @@ exports.Prisma.ModelName = {
Tariff: 'Tariff',
ContractCategory: 'ContractCategory',
Contract: 'Contract',
ContractHistoryEntry: 'ContractHistoryEntry',
ContractTask: 'ContractTask',
ContractTaskSubtask: 'ContractTaskSubtask',
EnergyContractDetails: 'EnergyContractDetails',
+1732 -6
View File
File diff suppressed because it is too large Load Diff
+14 -3
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "prisma-client-ab03eeebd49b41f4edbc7df102e0a7779d814508dbccb860745760460e9e271f",
"name": "prisma-client-652f85dbf9d7be282ff4b16714e4689fe4701aade21c76f6bcc5db624157e639",
"main": "index.js",
"types": "index.d.ts",
"browser": "index-browser.js",
+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 {
+11
View File
@@ -443,6 +443,16 @@ exports.Prisma.ContractScalarFieldEnum = {
updatedAt: 'updatedAt'
};
exports.Prisma.ContractHistoryEntryScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
title: 'title',
description: 'description',
isAutomatic: 'isAutomatic',
createdBy: 'createdBy',
createdAt: 'createdAt'
};
exports.Prisma.ContractTaskScalarFieldEnum = {
id: 'id',
contractId: 'contractId',
@@ -676,6 +686,7 @@ exports.Prisma.ModelName = {
Tariff: 'Tariff',
ContractCategory: 'ContractCategory',
Contract: 'Contract',
ContractHistoryEntry: 'ContractHistoryEntry',
ContractTask: 'ContractTask',
ContractTaskSubtask: 'ContractTaskSubtask',
EnergyContractDetails: 'EnergyContractDetails',