1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-10-16 15:07:27 +00:00

Create transactions table

This commit is contained in:
Steffo 2022-05-20 23:28:14 +02:00
parent 2792860e3e
commit 333ca3d55e
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -49,6 +49,8 @@ model Partecipant {
shouldBring Item[] shouldBring Item[]
drives Vehicle[] @relation("VehicleDrive") drives Vehicle[] @relation("VehicleDrive")
rides Vehicle[] @relation("VehicleRide") rides Vehicle[] @relation("VehicleRide")
expenses Transaction[] @relation("TransactionFrom")
income Transaction[] @relation("TransactionTo")
} }
enum PartecipationMeans { enum PartecipationMeans {
@ -109,3 +111,17 @@ enum VoyageType {
TO TO
FROM 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
}