AG Scroll Settings Budget Push und Rechnungsdokumente umsetzen
All checks were successful
CI / Build and Deploy (push) Successful in 2m20s

This commit is contained in:
jan
2026-05-05 21:57:20 +02:00
parent 99d4f6dd22
commit f87a82e02f
21 changed files with 885 additions and 323 deletions

View File

@@ -31,6 +31,11 @@ enum ExpenseRecurrence {
MONTHLY
}
enum BudgetReleaseNotifyTarget {
ALL_GROUP_USERS
GROUP_MEMBERS_ONLY
}
model User {
id String @id @default(cuid())
name String
@@ -44,6 +49,7 @@ model User {
workingGroup WorkingGroup? @relation(fields: [workingGroupId], references: [id], onDelete: SetNull)
createdExpenses Expense[] @relation("ExpenseCreator")
approvals Approval[]
uploadedDocuments ExpenseDocument[]
auditLogs AuditLog[]
pushSubscriptions PushSubscription[]
createdAt DateTime @default(now()) @map("created_at")
@@ -81,10 +87,12 @@ model AccountingPeriod {
}
model AppSettings {
id String @id @default("global")
approvalThreshold Decimal @default(50) @db.Decimal(10, 2) @map("approval_threshold")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
id String @id @default("global")
approvalThreshold Decimal @default(50) @db.Decimal(10, 2) @map("approval_threshold")
requiredApprovalTypes ApprovalType[] @default([CHAIR_A, CHAIR_B, FINANCE]) @map("required_approval_types")
budgetReleaseNotifyTarget BudgetReleaseNotifyTarget @default(ALL_GROUP_USERS) @map("budget_release_notify_target")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@map("app_settings")
}
@@ -133,8 +141,6 @@ model Expense {
recurrenceStartAt DateTime? @map("recurrence_start_at")
paidAt DateTime? @map("paid_at")
documentedAt DateTime? @map("documented_at")
invoiceDate DateTime? @map("invoice_date")
proofUrl String? @map("proof_url")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
creator User @relation("ExpenseCreator", fields: [creatorId], references: [id], onDelete: Restrict)
@@ -142,10 +148,31 @@ model Expense {
budget Budget @relation(fields: [budgetId], references: [id], onDelete: Restrict)
period AccountingPeriod @relation(fields: [periodId], references: [id], onDelete: Restrict)
approvals Approval[]
documents ExpenseDocument[]
@@map("expenses")
}
model ExpenseDocument {
id String @id @default(cuid())
expenseId String @map("expense_id")
invoiceDate DateTime @map("invoice_date")
proofUrl String @map("proof_url")
driveFileId String? @map("drive_file_id")
originalFileName String @map("original_file_name")
storedFileName String @map("stored_file_name")
mimeType String @map("mime_type")
size Int
uploadedById String @map("uploaded_by_id")
expense Expense @relation(fields: [expenseId], references: [id], onDelete: Cascade)
uploadedBy User @relation(fields: [uploadedById], references: [id], onDelete: Restrict)
createdAt DateTime @default(now()) @map("created_at")
@@index([expenseId])
@@index([uploadedById])
@@map("expense_documents")
}
model Approval {
id String @id @default(cuid())
expenseId String @map("expense_id")