5b01aa3d-f0b2-4a70-9e57-f4fd90682497

This commit is contained in:
Z User committed 2026-10-26 15:33:24 +00:00
1 parent d4c3b0f5ca
commit 34bd721ab1
23 files changed
+1461 -3

No files matched your search

+76
View File
@@ -337,3 +337,79 @@ model Expense {
updatedAt DateTime @updatedAt
}
// ---------------------------------------------------------------------------
// Support Tickets (PRD §6.7 + PerfEx Support Tickets + AI Integration)
// ---------------------------------------------------------------------------
model Ticket {
id String @id @default(cuid())
number String @unique // gapless, e.g. TKT-2026-0001
subject String
status String @default("open") // open|pending|resolved|closed
priority String @default("normal") // low|normal|high|urgent
categoryId String // bug|anfrage|aenderung|konto|rechnung|hosting
companyId String
projectId String?
licenseId String?
// SLA
slaResponseHours Int @default(8) // first response target
slaResolveHours Int @default(48) // resolution target
slaRespondedAt DateTime?
slaResolvedAt DateTime?
// AI
aiSummary String? // LLM-generated summary of the conversation
// assignee
assignee String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
messages TicketMessage[]
}
model TicketMessage {
id String @id @default(cuid())
ticketId String
ticket Ticket @relation(fields: [ticketId], references: [id])
fromType String // customer|staff|system
fromName String
body String
createdAt DateTime @default(now())
}
// ---------------------------------------------------------------------------
// Estimates / Angebote (PRD §6.5 sales-docs — quotes that convert to invoice)
// ---------------------------------------------------------------------------
model Estimate {
id String @id @default(cuid())
number String @unique // gapless, e.g. AN-2026-0001
companyId String
dealId String? // originating deal
projectId String? // creates project when accepted
subject String
status String @default("draft") // draft|sent|accepted|rejected|expired
validUntil DateTime?
issueDate DateTime @default(now())
acceptedAt DateTime?
acceptedBy String?
notes String?
netCents Int @default(0)
taxBp Int @default(1900)
grossCents Int @default(0)
// AI
aiDraftFromBrief String? // flag: was this drafted from a brief via AI
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
lines EstimateLine[]
}
model EstimateLine {
id String @id @default(cuid())
estimateId String
estimate Estimate @relation(fields: [estimateId], references: [id])
description String
quantity Int @default(1)
unitCents Int
totalCents Int
}