| 1 |
generator photon { |
| 2 |
provider = "photonjs" |
| 3 |
} |
| 4 |
|
| 5 |
model User { |
| 6 |
id String @default(cuid()) @id |
| 7 |
createdAt DateTime @default(now()) |
| 8 |
updatedAt DateTime @updatedAt |
| 9 |
firstName String |
| 10 |
lastName String |
| 11 |
email String @unique |
| 12 |
password String |
| 13 |
phone String |
| 14 |
responseRate Float? |
| 15 |
responseTime Int? |
| 16 |
ReportsTo User? @relation("EmployeeToEmployee_ReportsTo") |
| 17 |
employees User[] @relation("EmployeeToEmployee_ReportsTo") |
| 18 |
isSuperHost Boolean |
| 19 |
ownedPlaces Place[] |
| 20 |
location Location? |
| 21 |
bookings Booking[] |
| 22 |
paymentAccount PaymentAccount[] |
| 23 |
sentMessages Message[] @relation("SentMessages") |
| 24 |
receivedMessages Message[] @relation("ReceivedMessages") |
| 25 |
notifications Notification[] |
| 26 |
profilePicture Picture? |
| 27 |
hostingExperiences Experience[] |
| 28 |
} |
| 29 |
|
| 30 |
model Place { |
| 31 |
id String @default(cuid()) @id |
| 32 |
name String |
| 33 |
size PLACE_SIZES? |
| 34 |
shortDescription String |
| 35 |
description String |
| 36 |
slug String |
| 37 |
maxGuests Int |
| 38 |
numBedrooms Int |
| 39 |
numBeds Int |
| 40 |
numBaths Int |
| 41 |
reviews Review[] |
| 42 |
amenities Amenities |
| 43 |
host User |
| 44 |
pricing Pricing |
| 45 |
location Location |
| 46 |
views Views |
| 47 |
guestRequirements GuestRequirements? |
| 48 |
policies Policies? |
| 49 |
houseRules HouseRules? |
| 50 |
bookings Booking[] |
| 51 |
pictures Picture[] |
| 52 |
popularity Int |
| 53 |
} |
| 54 |
|
| 55 |
model Pricing { |
| 56 |
id String @default(cuid()) @id |
| 57 |
place Place |
| 58 |
monthlyDiscount Int? |
| 59 |
weeklyDiscount Int? |
| 60 |
perNight Int |
| 61 |
smartPricing Boolean |
| 62 |
basePrice Int |
| 63 |
averageWeekly Int |
| 64 |
averageMonthly Int |
| 65 |
cleaningFee Int? |
| 66 |
securityDeposit Int? |
| 67 |
extraGuests Int? |
| 68 |
weekendPricing Int? |
| 69 |
currency CURRENCY? |
| 70 |
} |
| 71 |
|
| 72 |
model GuestRequirements { |
| 73 |
id String @default(cuid()) @id |
| 74 |
govIssuedId Boolean |
| 75 |
recommendationsFromOtherHosts Boolean |
| 76 |
guestTripInformation Boolean |
| 77 |
place Place |
| 78 |
} |
| 79 |
|
| 80 |
model Policies { |
| 81 |
id String @default(cuid()) @id |
| 82 |
createdAt DateTime @default(now()) |
| 83 |
updatedAt DateTime @updatedAt |
| 84 |
checkInStartTime Float |
| 85 |
checkInEndTime Float |
| 86 |
checkoutTime Float |
| 87 |
place Place |
| 88 |
} |
| 89 |
|
| 90 |
model HouseRules { |
| 91 |
id String @default(cuid()) @id |
| 92 |
createdAt DateTime @default(now()) |
| 93 |
updatedAt DateTime @updatedAt |
| 94 |
suitableForChildren Boolean? |
| 95 |
suitableForInfants Boolean? |
| 96 |
petsAllowed Boolean? |
| 97 |
smokingAllowed Boolean? |
| 98 |
partiesAndEventsAllowed Boolean? |
| 99 |
additionalRules String? |
| 100 |
} |
| 101 |
|
| 102 |
model Views { |
| 103 |
id String @default(cuid()) @id |
| 104 |
lastWeek Int |
| 105 |
place Place |
| 106 |
} |
| 107 |
|
| 108 |
model Location { |
| 109 |
id String @default(cuid()) @id |
| 110 |
lat Float |
| 111 |
lng Float |
| 112 |
neighbourHood Neighbourhood? |
| 113 |
user User? |
| 114 |
place Place? |
| 115 |
address String |
| 116 |
directions String |
| 117 |
experience Experience? |
| 118 |
restaurant Restaurant? |
| 119 |
} |
| 120 |
|
| 121 |
model Neighbourhood { |
| 122 |
id String @default(cuid()) @id |
| 123 |
locations Location[] |
| 124 |
name String |
| 125 |
slug String |
| 126 |
homePreview Picture? |
| 127 |
city City |
| 128 |
featured Boolean |
| 129 |
popularity Int |
| 130 |
} |
| 131 |
|
| 132 |
model City { |
| 133 |
id String @default(cuid()) @id |
| 134 |
name String |
| 135 |
neighbourhoods Neighbourhood[] |
| 136 |
} |
| 137 |
|
| 138 |
model Picture { |
| 139 |
id String @default(cuid()) @id |
| 140 |
url String |
| 141 |
} |
| 142 |
|
| 143 |
model Experience { |
| 144 |
id String @default(cuid()) @id |
| 145 |
category ExperienceCategory? |
| 146 |
title String |
| 147 |
host User |
| 148 |
location Location |
| 149 |
pricePerPerson Int |
| 150 |
reviews Review[] |
| 151 |
preview Picture |
| 152 |
popularity Int |
| 153 |
} |
| 154 |
|
| 155 |
model ExperienceCategory { |
| 156 |
id String @default(cuid()) @id |
| 157 |
mainColor String |
| 158 |
name String |
| 159 |
experience Experience? |
| 160 |
} |
| 161 |
|
| 162 |
model Amenities { |
| 163 |
id String @default(cuid()) @id |
| 164 |
place Place |
| 165 |
elevator Boolean |
| 166 |
petsAllowed Boolean |
| 167 |
internet Boolean |
| 168 |
kitchen Boolean |
| 169 |
wirelessInternet Boolean |
| 170 |
familyKidFriendly Boolean |
| 171 |
freeParkingOnPremises Boolean |
| 172 |
hotTub Boolean |
| 173 |
pool Boolean |
| 174 |
smokingAllowed Boolean |
| 175 |
wheelchairAccessible Boolean |
| 176 |
breakfast Boolean |
| 177 |
cableTv Boolean |
| 178 |
suitableForEvents Boolean |
| 179 |
dryer Boolean |
| 180 |
washer Boolean |
| 181 |
indoorFireplace Boolean |
| 182 |
tv Boolean |
| 183 |
heating Boolean |
| 184 |
hangers Boolean |
| 185 |
iron Boolean |
| 186 |
hairDryer Boolean |
| 187 |
doorman Boolean |
| 188 |
paidParkingOffPremises Boolean |
| 189 |
freeParkingOnStreet Boolean |
| 190 |
gym Boolean |
| 191 |
airConditioning Boolean |
| 192 |
shampoo Boolean |
| 193 |
essentials Boolean |
| 194 |
laptopFriendlyWorkspace Boolean |
| 195 |
privateEntrance Boolean |
| 196 |
buzzerWirelessIntercom Boolean |
| 197 |
babyBath Boolean |
| 198 |
babyMonitor Boolean |
| 199 |
babysitterRecommendations Boolean |
| 200 |
bathtub Boolean |
| 201 |
changingTable Boolean |
| 202 |
childrensBooksAndToys Boolean |
| 203 |
childrensDinnerware Boolean |
| 204 |
crib Boolean |
| 205 |
} |
| 206 |
|
| 207 |
model Review { |
| 208 |
id String @default(cuid()) @id |
| 209 |
createdAt DateTime @default(now()) |
| 210 |
text String |
| 211 |
stars Int |
| 212 |
accuracy Int |
| 213 |
location Int |
| 214 |
checkIn Int |
| 215 |
value Int |
| 216 |
cleanliness Int |
| 217 |
communication Int |
| 218 |
place Place |
| 219 |
experience Experience? |
| 220 |
} |
| 221 |
|
| 222 |
model Booking { |
| 223 |
id String @default(cuid()) @id |
| 224 |
createdAt DateTime @default(now()) |
| 225 |
bookee User |
| 226 |
place Place |
| 227 |
startDate DateTime |
| 228 |
endDate DateTime |
| 229 |
payment Payment? |
| 230 |
} |
| 231 |
|
| 232 |
model Payment { |
| 233 |
id String @default(cuid()) @id |
| 234 |
createdAt DateTime @default(now()) |
| 235 |
serviceFee Float |
| 236 |
placePrice Float |
| 237 |
totalPrice Float |
| 238 |
booking Booking |
| 239 |
paymentMethod PaymentAccount |
| 240 |
} |
| 241 |
|
| 242 |
model PaymentAccount { |
| 243 |
id String @default(cuid()) @id |
| 244 |
createdAt DateTime @default(now()) |
| 245 |
type PAYMENT_PROVIDER? |
| 246 |
user User |
| 247 |
payments Payment[] |
| 248 |
paypal PaypalInformation? |
| 249 |
creditcard CreditCardInformation? |
| 250 |
} |
| 251 |
|
| 252 |
model PaypalInformation { |
| 253 |
id String @default(cuid()) @id |
| 254 |
createdAt DateTime @default(now()) |
| 255 |
email String |
| 256 |
paymentAccount PaymentAccount |
| 257 |
} |
| 258 |
|
| 259 |
model CreditCardInformation { |
| 260 |
id String @default(cuid()) @id |
| 261 |
createdAt DateTime @default(now()) |
| 262 |
cardNumber String |
| 263 |
expiresOnMonth Int |
| 264 |
expiresOnYear Int |
| 265 |
securityCode String |
| 266 |
firstName String |
| 267 |
lastName String |
| 268 |
postalCode String |
| 269 |
country String |
| 270 |
paymentAccount PaymentAccount? |
| 271 |
} |
| 272 |
|
| 273 |
model Message { |
| 274 |
id String @default(cuid()) @id |
| 275 |
createdAt DateTime @default(now()) |
| 276 |
from User @relation("SentMessages") |
| 277 |
to User @relation("ReceivedMessages") |
| 278 |
deliveredAt DateTime |
| 279 |
readAt DateTime |
| 280 |
} |
| 281 |
|
| 282 |
model Notification { |
| 283 |
id String @default(cuid()) @id |
| 284 |
createdAt DateTime @default(now()) |
| 285 |
type NOTIFICATION_TYPE? |
| 286 |
user User |
| 287 |
link String |
| 288 |
readDate DateTime |
| 289 |
} |
| 290 |
|
| 291 |
model Restaurant { |
| 292 |
id String @default(cuid()) @id |
| 293 |
createdAt DateTime @default(now()) |
| 294 |
title String |
| 295 |
avgPricePerPerson Int |
| 296 |
pictures Picture[] |
| 297 |
location Location |
| 298 |
isCurated Boolean |
| 299 |
slug String |
| 300 |
popularity Int |
| 301 |
} |
| 302 |
|
| 303 |
enum CURRENCY { |
| 304 |
CAD |
| 305 |
CHF |
| 306 |
EUR |
| 307 |
JPY |
| 308 |
USD |
| 309 |
ZAR |
| 310 |
} |
| 311 |
|
| 312 |
enum PLACE_SIZES { |
| 313 |
ENTIRE_HOUSE |
| 314 |
ENTIRE_APARTMENT |
| 315 |
ENTIRE_EARTH_HOUSE |
| 316 |
ENTIRE_CABIN |
| 317 |
ENTIRE_VILLA |
| 318 |
ENTIRE_PLACE |
| 319 |
ENTIRE_BOAT |
| 320 |
PRIVATE_ROOM |
| 321 |
} |
| 322 |
|
| 323 |
enum PAYMENT_PROVIDER { |
| 324 |
PAYPAL |
| 325 |
CREDIT_CARD |
| 326 |
} |
| 327 |
|
| 328 |
enum NOTIFICATION_TYPE { |
| 329 |
OFFER |
| 330 |
INSTANT_BOOK |
| 331 |
RESPONSIVENESS |
| 332 |
NEW_AMENITIES |
| 333 |
HOUSE_RULES |
| 334 |
} |