1bc42b25-8a92-4b1e-9e45-a4dba3d1ac57
This commit is contained in:
1 parent
5855f699f3
commit
d4c3b0f5ca
21 files changed
+1140
No files matched your search
@@ -275,3 +275,65 @@ model InvoiceLine {
|
||||
unitCents Int
|
||||
totalCents Int
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Contracts / Verträge (Phase 5 — adapted from PerfEx Contracts, Germanized)
|
||||
// German contract types: Werkvertrag, Dienstvertrag, Wartungsvertrag/SLA,
|
||||
// AVV (Auftragsverarbeitungsvertrag), NDA, AVV
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
model Contract {
|
||||
id String @id @default(cuid())
|
||||
number String @unique // gapless, e.g. VER-2026-0001
|
||||
companyId String
|
||||
type String // werkvertrag|dienstvertrag|wartung-sla|avv|nda|dpa
|
||||
title String
|
||||
status String @default("draft") // draft|sent|signed|active|expired|terminated
|
||||
valueCents Int @default(0)
|
||||
startDate DateTime?
|
||||
endDate DateTime? // null = unbefristet
|
||||
templateId String? // reference to a stored template
|
||||
dealId String? // optional link to originating deal
|
||||
projectId String? // optional link to project
|
||||
// E-signature hook (mock)
|
||||
signedAt DateTime?
|
||||
signedBy String? // signer name/email
|
||||
signedIp String?
|
||||
signToken String? // unique token for the signing link
|
||||
notes String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Expenses / Ausgaben (adapted from PerfEx Expenses, Germanized for DATEV)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
model Expense {
|
||||
id String @id @default(cuid())
|
||||
number String @unique // gapless, e.g. AUS-2026-0001
|
||||
categoryId String // reise|software|hardware|fremdleistung|buero|marketing
|
||||
vendor String? // supplier / merchant
|
||||
description String
|
||||
amountCents Int // net amount
|
||||
taxBp Int @default(1900)
|
||||
grossCents Int @default(0)
|
||||
date DateTime @default(now())
|
||||
// linking
|
||||
companyId String? // customer this is billable to
|
||||
projectId String? // project this relates to
|
||||
billable Boolean @default(false) // convert to customer invoice
|
||||
markupPct Int @default(0) // markup when re-billed
|
||||
// recurring
|
||||
recurring Boolean @default(false)
|
||||
recurringInterval String? // monthly|quarterly|yearly
|
||||
// receipt + export
|
||||
receiptHash String? // SHA-256 of stored receipt file (content-addressed)
|
||||
datevExported Boolean @default(false)
|
||||
// conversion
|
||||
convertedInvoiceId String? // link to the invoice created from this expense
|
||||
status String @default("recorded") // recorded|approved|invoiced|rejected
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user