ADD: added some quiality of life features

This commit is contained in:
hwinkel
2026-03-15 19:53:11 +01:00
parent f5b259cae2
commit 40a2764dd0
30 changed files with 1397 additions and 51 deletions
+18 -1
View File
@@ -69,12 +69,28 @@ model Company {
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
customers Customer[]
invoices Invoice[]
services Service[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("companies")
}
model Service {
id String @id @default(cuid())
companyId String
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
name String
description String? @db.Text
unit String?
unitPrice Decimal @db.Decimal(10, 2)
taxRate Decimal @db.Decimal(5, 2)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("services")
}
model Customer {
id String @id @default(cuid())
companyId String
@@ -96,7 +112,7 @@ model Customer {
model Invoice {
id String @id @default(cuid())
number String
number String?
companyId String
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
customerId String
@@ -113,6 +129,7 @@ model Invoice {
grossTotal Decimal @db.Decimal(10, 2)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
deletedAt DateTime?
@@unique([companyId, number])
@@map("invoices")