diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2024-01-28 18:51:29 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-28 18:51:29 -0500 |
| commit | d43e731fe191d7e35d96847fe095c94555dd8ca6 (patch) | |
| tree | b8bc3f99770a47ec0343f642ca04e727f7abd716 /prisma/schema.prisma | |
| parent | 11d2e298e8cc5cac07aa2c60e194bf4460cefb21 (diff) | |
Attach documents to expenses (#64)
* Upload documents to receipts
* Improve documents
* Make the feature opt-in
* Fix file name issue
Diffstat (limited to 'prisma/schema.prisma')
| -rw-r--r-- | prisma/schema.prisma | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 1fbfc65..394342d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -37,20 +37,30 @@ model Category { } model Expense { - id String @id - group Group @relation(fields: [groupId], references: [id], onDelete: Cascade) - expenseDate DateTime @default(dbgenerated("CURRENT_DATE")) @db.Date + id String @id + group Group @relation(fields: [groupId], references: [id], onDelete: Cascade) + expenseDate DateTime @default(dbgenerated("CURRENT_DATE")) @db.Date title String - category Category? @relation(fields: [categoryId], references: [id]) - categoryId Int @default(0) + category Category? @relation(fields: [categoryId], references: [id]) + categoryId Int @default(0) amount Int - paidBy Participant @relation(fields: [paidById], references: [id], onDelete: Cascade) + paidBy Participant @relation(fields: [paidById], references: [id], onDelete: Cascade) paidById String paidFor ExpensePaidFor[] groupId String - isReimbursement Boolean @default(false) - splitMode SplitMode @default(EVENLY) - createdAt DateTime @default(now()) + isReimbursement Boolean @default(false) + splitMode SplitMode @default(EVENLY) + createdAt DateTime @default(now()) + documents ExpenseDocument[] +} + +model ExpenseDocument { + id String @id + url String + width Int + height Int + Expense Expense? @relation(fields: [expenseId], references: [id]) + expenseId String? } enum SplitMode { |
