mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-27 01:46:12 +01:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user