mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-23 07:04:22 +00:00
Add collective items to the schema
This commit is contained in:
parent
7cd9209110
commit
3b77ac1d2f
1 changed files with 38 additions and 22 deletions
|
@ -28,6 +28,7 @@ model Event {
|
||||||
location String?
|
location String?
|
||||||
//
|
//
|
||||||
partecipants Partecipant[]
|
partecipants Partecipant[]
|
||||||
|
neededItems CollectiveItem[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A partecipant is a person who may or may not partecipate to the event.
|
/// A partecipant is a person who may or may not partecipate to the event.
|
||||||
|
@ -44,6 +45,7 @@ model Partecipant {
|
||||||
joinedAt DateTime?
|
joinedAt DateTime?
|
||||||
//
|
//
|
||||||
answer PartecipationAnswer
|
answer PartecipationAnswer
|
||||||
|
shouldBring CollectiveItem[]
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PartecipationMeans {
|
enum PartecipationMeans {
|
||||||
|
@ -60,3 +62,17 @@ enum PartecipationAnswer {
|
||||||
NO
|
NO
|
||||||
PENDING
|
PENDING
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// An item which should be bought and brought by somebody to the event.
|
||||||
|
model CollectiveItem {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
eventId Int
|
||||||
|
event Event @relation(fields: [eventId], references: [id])
|
||||||
|
//
|
||||||
|
quantity Int
|
||||||
|
name String
|
||||||
|
purchased Boolean @default(false)
|
||||||
|
//
|
||||||
|
assignedId Int?
|
||||||
|
assigned Partecipant? @relation(fields: [assignedId], references: [id])
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue