mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-22 14:44:21 +00:00
Create transactions table
This commit is contained in:
parent
2792860e3e
commit
333ca3d55e
1 changed files with 16 additions and 0 deletions
|
@ -49,6 +49,8 @@ model Partecipant {
|
|||
shouldBring Item[]
|
||||
drives Vehicle[] @relation("VehicleDrive")
|
||||
rides Vehicle[] @relation("VehicleRide")
|
||||
expenses Transaction[] @relation("TransactionFrom")
|
||||
income Transaction[] @relation("TransactionTo")
|
||||
}
|
||||
|
||||
enum PartecipationMeans {
|
||||
|
@ -109,3 +111,17 @@ enum VoyageType {
|
|||
TO
|
||||
FROM
|
||||
}
|
||||
|
||||
/// A monetary transaction related to the event.
|
||||
model Transaction {
|
||||
id Int @id @default(autoincrement())
|
||||
//
|
||||
fromId Int?
|
||||
from Partecipant? @relation("TransactionFrom", fields: [fromId], references: [id])
|
||||
toId Int?
|
||||
to Partecipant? @relation("TransactionTo", fields: [toId], references: [id])
|
||||
//
|
||||
amount Decimal
|
||||
currency String
|
||||
reason String
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue