feat: implement manageable homepage banner slider with support for businesses and custom slides
This commit is contained in:
@@ -30,11 +30,11 @@ model User {
|
||||
businesses Business?
|
||||
comments Comment[]
|
||||
conversations ConversationParticipant[]
|
||||
favorites Favorite[]
|
||||
sentMessages Message[]
|
||||
reports MessageReport[]
|
||||
ratings Rating[]
|
||||
country Country? @relation(fields: [countryId], references: [id])
|
||||
favorites Favorite[]
|
||||
}
|
||||
|
||||
model Business {
|
||||
@@ -68,8 +68,6 @@ model Business {
|
||||
websiteUrl String?
|
||||
isSuspended Boolean @default(false)
|
||||
suspensionReason String?
|
||||
metaTitle String?
|
||||
metaDescription String?
|
||||
plan Plan @default(STARTER)
|
||||
city String?
|
||||
countryId String?
|
||||
@@ -78,14 +76,17 @@ model Business {
|
||||
coverZoom Float? @default(1.0)
|
||||
suggestedCategory String?
|
||||
categoryId String?
|
||||
metaDescription String?
|
||||
metaTitle String?
|
||||
categoryRef BusinessCategory? @relation(fields: [categoryId], references: [id])
|
||||
country Country? @relation(fields: [countryId], references: [id])
|
||||
owner User @relation(fields: [ownerId], references: [id])
|
||||
comments Comment[]
|
||||
conversations Conversation[]
|
||||
favorites Favorite[]
|
||||
homeSlides HomeSlide[]
|
||||
offers Offer[]
|
||||
ratings Rating[]
|
||||
favorites Favorite[]
|
||||
}
|
||||
|
||||
model BusinessCategory {
|
||||
@@ -161,6 +162,21 @@ model BlogPost {
|
||||
status ContentStatus @default(PUBLISHED)
|
||||
}
|
||||
|
||||
model HomeSlide {
|
||||
id String @id @default(uuid())
|
||||
type HomeSlideType @default(CUSTOM)
|
||||
businessId String?
|
||||
title String?
|
||||
subtitle String?
|
||||
imageUrl String?
|
||||
linkUrl String?
|
||||
order Int @default(0)
|
||||
isActive Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
business Business? @relation(fields: [businessId], references: [id])
|
||||
}
|
||||
|
||||
model Interview {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
@@ -332,12 +348,17 @@ model Favorite {
|
||||
userId String
|
||||
businessId String
|
||||
createdAt DateTime @default(now())
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([userId, businessId])
|
||||
}
|
||||
|
||||
enum HomeSlideType {
|
||||
BUSINESS
|
||||
CUSTOM
|
||||
}
|
||||
|
||||
enum ContentStatus {
|
||||
DRAFT
|
||||
PUBLISHED
|
||||
|
||||
Reference in New Issue
Block a user