186 lines
4.8 KiB
Plaintext
186 lines
4.8 KiB
Plaintext
//////////////////////////////////////////////////////////////////////////////////////////////
|
|
// DO NOT MODIFY THIS FILE //
|
|
// This file is automatically generated by ZenStack CLI and should not be manually updated. //
|
|
//////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
enum UserType {
|
|
User
|
|
Scanner
|
|
Admin
|
|
}
|
|
|
|
enum DrinkType {
|
|
Drink
|
|
Beer
|
|
Wine
|
|
Soda
|
|
Cocktail
|
|
}
|
|
|
|
enum ContainerType {
|
|
BeerBottle
|
|
WineBottle
|
|
PlasticBottle
|
|
Can
|
|
Carton
|
|
Keg
|
|
}
|
|
|
|
model Drink {
|
|
id Int @id() @default(autoincrement())
|
|
slug String @unique()
|
|
manufacturer_id Int
|
|
manufacturer Manufacturer @relation(fields: [manufacturer_id], references: [id])
|
|
type DrinkType
|
|
name String @unique()
|
|
description String
|
|
abv Float
|
|
image String?
|
|
link String?
|
|
gluten Boolean
|
|
lactose Boolean
|
|
organic Boolean
|
|
sugar Boolean @default(true)
|
|
addedAt DateTime @default(now())
|
|
containers Container[]
|
|
delegate_aux_beer Beer?
|
|
delegate_aux_wine Wine?
|
|
delegate_aux_soda Soda?
|
|
delegate_aux_cocktail Cocktail?
|
|
}
|
|
|
|
model Beer {
|
|
id Int @id()
|
|
style_id Int
|
|
style BeerStyle @relation(fields: [style_id], references: [id])
|
|
ibu Float?
|
|
glass Boolean @default(false)
|
|
delegate_aux_drink Drink @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
}
|
|
|
|
model BeerStyle {
|
|
id Int @id() @default(autoincrement())
|
|
name String @unique()
|
|
color String
|
|
beers Beer[]
|
|
}
|
|
|
|
model Wine {
|
|
id Int @id()
|
|
style_id Int
|
|
style WineStyle @relation(fields: [style_id], references: [id])
|
|
heavy_score Int?
|
|
tannine_score Int?
|
|
dry_score Int?
|
|
fresh_score Int?
|
|
notes String?
|
|
delegate_aux_drink Drink @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
}
|
|
|
|
model WineStyle {
|
|
id Int @id() @default(autoincrement())
|
|
name String @unique()
|
|
color String
|
|
wines Wine[]
|
|
}
|
|
|
|
model Soda {
|
|
id Int @id()
|
|
carbonated Boolean
|
|
delegate_aux_drink Drink @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
}
|
|
|
|
model Cocktail {
|
|
id Int @id()
|
|
mix Boolean
|
|
delegate_aux_drink Drink @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
}
|
|
|
|
model Container {
|
|
id Int @id() @default(autoincrement())
|
|
barcode String? @unique()
|
|
drink_id Int
|
|
drink Drink @relation(fields: [drink_id], references: [id])
|
|
section_id Int
|
|
section Section @relation(fields: [section_id], references: [id])
|
|
type ContainerType
|
|
volume Int
|
|
portions Int?
|
|
price Float @default(0.0)
|
|
inventory Int @default(0)
|
|
lastAdded DateTime?
|
|
checkouts History[]
|
|
}
|
|
|
|
model Section {
|
|
id Int @id() @default(autoincrement())
|
|
name String @unique()
|
|
containers Container[]
|
|
}
|
|
|
|
model Manufacturer {
|
|
id Int @id() @default(autoincrement())
|
|
country_id String
|
|
country Country @relation(fields: [country_id], references: [code])
|
|
name String @unique()
|
|
description String?
|
|
image String?
|
|
drinks Drink[]
|
|
}
|
|
|
|
model Country {
|
|
code String @id()
|
|
name String
|
|
manufacturers Manufacturer[]
|
|
}
|
|
|
|
model History {
|
|
id Int @id() @default(autoincrement())
|
|
container_id Int
|
|
container Container @relation(fields: [container_id], references: [id])
|
|
checkoutAt DateTime @default(now())
|
|
inventoryAfter Int
|
|
}
|
|
|
|
model User {
|
|
id Int @id() @default(autoincrement())
|
|
username String @unique()
|
|
password String
|
|
type UserType
|
|
sessions Session[]
|
|
}
|
|
|
|
model Session {
|
|
id String @id() @default(uuid())
|
|
createdAt DateTime @default(now())
|
|
user_id Int?
|
|
user User? @relation(fields: [user_id], references: [id])
|
|
data String
|
|
}
|
|
|
|
model Suggestion {
|
|
id Int @id() @default(autoincrement())
|
|
createdAt DateTime @default(now())
|
|
name String?
|
|
content String
|
|
resolved Boolean @default(false)
|
|
}
|
|
|
|
model Report {
|
|
id Int @id() @default(autoincrement())
|
|
createdAt DateTime @default(now())
|
|
name String @unique()
|
|
dateStart DateTime
|
|
dateEnd DateTime
|
|
file String?
|
|
}
|