mirror of
https://github.com/Steffo99/festa.git
synced 2025-01-03 12:34:20 +00:00
Add ride sharing entities
This commit is contained in:
parent
3b77ac1d2f
commit
6145bc414c
1 changed files with 33 additions and 6 deletions
|
@ -12,11 +12,11 @@ datasource db {
|
||||||
|
|
||||||
/// An event is the representation of a gathering of people in a certain place at a certain time.
|
/// An event is the representation of a gathering of people in a certain place at a certain time.
|
||||||
model Event {
|
model Event {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
//
|
//
|
||||||
slug String
|
slug String
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
viewPassword String?
|
viewPassword String?
|
||||||
joinPassword String?
|
joinPassword String?
|
||||||
//
|
//
|
||||||
|
@ -28,7 +28,8 @@ model Event {
|
||||||
location String?
|
location String?
|
||||||
//
|
//
|
||||||
partecipants Partecipant[]
|
partecipants Partecipant[]
|
||||||
neededItems CollectiveItem[]
|
neededItems Item[]
|
||||||
|
vehicles Vehicle[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 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.
|
||||||
|
@ -45,7 +46,9 @@ model Partecipant {
|
||||||
joinedAt DateTime?
|
joinedAt DateTime?
|
||||||
//
|
//
|
||||||
answer PartecipationAnswer
|
answer PartecipationAnswer
|
||||||
shouldBring CollectiveItem[]
|
shouldBring Item[]
|
||||||
|
drives Vehicle[] @relation("VehicleDrive")
|
||||||
|
rides Vehicle[] @relation("VehicleRide")
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PartecipationMeans {
|
enum PartecipationMeans {
|
||||||
|
@ -64,7 +67,7 @@ enum PartecipationAnswer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An item which should be bought and brought by somebody to the event.
|
/// An item which should be bought and brought by somebody to the event.
|
||||||
model CollectiveItem {
|
model Item {
|
||||||
id Int @id @default(autoincrement())
|
id Int @id @default(autoincrement())
|
||||||
eventId Int
|
eventId Int
|
||||||
event Event @relation(fields: [eventId], references: [id])
|
event Event @relation(fields: [eventId], references: [id])
|
||||||
|
@ -76,3 +79,27 @@ model CollectiveItem {
|
||||||
assignedId Int?
|
assignedId Int?
|
||||||
assigned Partecipant? @relation(fields: [assignedId], references: [id])
|
assigned Partecipant? @relation(fields: [assignedId], references: [id])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A vehicle which is being used to transport people from and to the event.
|
||||||
|
model Vehicle {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
eventId Int
|
||||||
|
event Event @relation(fields: [eventId], references: [id])
|
||||||
|
//
|
||||||
|
driverId Int
|
||||||
|
driver Partecipant @relation("VehicleDrive", fields: [driverId], references: [id])
|
||||||
|
riders Partecipant[] @relation("VehicleRide")
|
||||||
|
//
|
||||||
|
slots Int @default(4)
|
||||||
|
password String?
|
||||||
|
//
|
||||||
|
voyage VoyageType
|
||||||
|
location String
|
||||||
|
departureAt DateTime
|
||||||
|
arrivalAt DateTime
|
||||||
|
}
|
||||||
|
|
||||||
|
enum VoyageType {
|
||||||
|
TO
|
||||||
|
FROM
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue