diff options
| author | Chris Johnston <christopher_johnston@me.com> | 2024-01-11 21:38:30 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-11 16:38:30 -0500 |
| commit | 45ee9cdba4e6e7c9ac918859b89d2b2ed38d4571 (patch) | |
| tree | fab43518bdb1dce24bb9731b6f41f7f73a193282 /prisma/schema.prisma | |
| parent | 057f3e9c533704d9f1d695e8df9c4779c983c337 (diff) | |
Assign categories to expenses (#28)
* add expense categories
* set category to Payment for reimbursements
* Insert categories as part of the migration
* Display category groups
---------
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
Diffstat (limited to 'prisma/schema.prisma')
| -rw-r--r-- | prisma/schema.prisma | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 42d4cfc..1fbfc65 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -29,11 +29,20 @@ model Participant { expensesPaidFor ExpensePaidFor[] } +model Category { + id Int @id @default(autoincrement()) + grouping String + name String + Expense Expense[] +} + model Expense { id String @id group Group @relation(fields: [groupId], references: [id], onDelete: Cascade) - expenseDate DateTime @db.Date @default(dbgenerated("CURRENT_DATE")) + expenseDate DateTime @default(dbgenerated("CURRENT_DATE")) @db.Date title String + category Category? @relation(fields: [categoryId], references: [id]) + categoryId Int @default(0) amount Int paidBy Participant @relation(fields: [paidById], references: [id], onDelete: Cascade) paidById String |
