Template API: create database schema
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
model Template {
|
||||
id String @id @default(uuid())
|
||||
language String
|
||||
deliveryCharge String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
address Address?
|
||||
banner Banner?
|
||||
ingredient Ingredient?
|
||||
instruction Instruction?
|
||||
faq FAQ?
|
||||
tips Tips?
|
||||
priceCombo PriceCombo?
|
||||
product Product?
|
||||
}
|
||||
|
||||
// banner model
|
||||
model Banner {
|
||||
id String @id @default(uuid())
|
||||
isVisible Boolean
|
||||
bannerTitle String
|
||||
bannerDesc String
|
||||
bannerImage String
|
||||
templateId String @unique
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
}
|
||||
|
||||
// address model
|
||||
model Address {
|
||||
id String @id @default(uuid())
|
||||
isVisible Boolean
|
||||
phoneNumber String
|
||||
shopLocation String
|
||||
shopEmail String
|
||||
templateId String @unique
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
}
|
||||
|
||||
//ingredient model
|
||||
model Ingredient {
|
||||
id String @id @default(uuid())
|
||||
isVisible Boolean
|
||||
templateId String @unique
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
options ingredientOptions[]
|
||||
}
|
||||
|
||||
//ingredient options model
|
||||
model ingredientOptions {
|
||||
id String @id @default(uuid())
|
||||
ingrImg String
|
||||
ingrTitle String
|
||||
ingrDes String
|
||||
ingredientId String
|
||||
ingredient Ingredient @relation(fields: [ingredientId], references: [id])
|
||||
}
|
||||
|
||||
//instruction model & instruction options
|
||||
model Instruction {
|
||||
id String @id @default(uuid())
|
||||
isVisible Boolean
|
||||
instBanner String
|
||||
templateId String @unique
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
options InstructionOptions[]
|
||||
}
|
||||
|
||||
model InstructionOptions {
|
||||
id String @id @default(uuid())
|
||||
hint String
|
||||
detail String
|
||||
instructionId String
|
||||
instruction Instruction @relation(fields: [instructionId], references: [id])
|
||||
}
|
||||
|
||||
//FAQ & FAQOptions model
|
||||
model FAQ {
|
||||
id String @id @default(uuid())
|
||||
isVisible Boolean
|
||||
templateId String @unique
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
options FAQOptions[]
|
||||
}
|
||||
|
||||
model FAQOptions {
|
||||
id String @id @default(uuid())
|
||||
index Int
|
||||
text String
|
||||
|
||||
faqId String
|
||||
faq FAQ @relation(fields: [faqId], references: [id])
|
||||
}
|
||||
|
||||
//Tips & Tips options model
|
||||
model Tips {
|
||||
id String @id @default(uuid())
|
||||
isVisible Boolean
|
||||
tipsBanner String
|
||||
templateId String @unique
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
options TipsOption[]
|
||||
}
|
||||
|
||||
model TipsOption {
|
||||
id String @id @default(uuid())
|
||||
index Int
|
||||
text String
|
||||
|
||||
tipsId String
|
||||
tips Tips @relation(fields: [tipsId], references: [id])
|
||||
}
|
||||
|
||||
//PriceCombo & PriceComboOptions model
|
||||
model PriceCombo {
|
||||
id String @id @default(uuid())
|
||||
isVisible Boolean
|
||||
templateId String @unique
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
options PriceOption[]
|
||||
}
|
||||
|
||||
model PriceOption {
|
||||
id String @id @default(uuid())
|
||||
quantity String
|
||||
price String
|
||||
comboId String
|
||||
combo PriceCombo @relation(fields: [comboId], references: [id])
|
||||
}
|
||||
|
||||
//product model
|
||||
model Product {
|
||||
id String @id @default(uuid())
|
||||
isVisible Boolean
|
||||
price String
|
||||
discount Int
|
||||
productName String
|
||||
templateId String @unique
|
||||
template Template @relation(fields: [templateId], references: [id])
|
||||
}
|
||||
Reference in New Issue
Block a user