.
This commit is contained in:
@@ -6,66 +6,45 @@ datasource db {
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
enum UserRole {
|
||||
VISITOR
|
||||
ENTREPRENEUR
|
||||
ADMIN
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
email String @unique
|
||||
password String
|
||||
role UserRole @default(VISITOR)
|
||||
avatar String?
|
||||
|
||||
businesses Business[]
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
email String @unique
|
||||
password String
|
||||
role UserRole @default(VISITOR)
|
||||
avatar String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
businesses Business?
|
||||
comments Comment[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Business {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
category String
|
||||
location String
|
||||
description String @db.Text
|
||||
logoUrl String
|
||||
videoUrl String?
|
||||
|
||||
// Contact & Social
|
||||
contactEmail String
|
||||
contactPhone String?
|
||||
// We use JSON to store social links (facebook, linkedin, instagram, website)
|
||||
socialLinks Json?
|
||||
|
||||
// Stats
|
||||
verified Boolean @default(false)
|
||||
viewCount Int @default(0)
|
||||
rating Float @default(0.0)
|
||||
tags String[]
|
||||
|
||||
// Entrepreneur of the Month fields
|
||||
isFeatured Boolean @default(false)
|
||||
founderName String?
|
||||
founderImageUrl String?
|
||||
keyMetric String?
|
||||
|
||||
// Relations
|
||||
ownerId String @unique
|
||||
owner User @relation(fields: [ownerId], references: [id])
|
||||
offers Offer[]
|
||||
comments Comment[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
enum OfferType {
|
||||
PRODUCT
|
||||
SERVICE
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
category String
|
||||
location String
|
||||
description String
|
||||
logoUrl String
|
||||
videoUrl String?
|
||||
contactEmail String
|
||||
contactPhone String?
|
||||
socialLinks Json?
|
||||
verified Boolean @default(false)
|
||||
viewCount Int @default(0)
|
||||
rating Float @default(0.0)
|
||||
tags String[]
|
||||
isFeatured Boolean @default(false)
|
||||
founderName String?
|
||||
founderImageUrl String?
|
||||
keyMetric String?
|
||||
ownerId String @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
slug String? @unique
|
||||
owner User @relation(fields: [ownerId], references: [id])
|
||||
comments Comment[]
|
||||
offers Offer[]
|
||||
}
|
||||
|
||||
model Offer {
|
||||
@@ -73,37 +52,28 @@ model Offer {
|
||||
title String
|
||||
type OfferType
|
||||
price Float
|
||||
currency String @default("XOF") // EUR or XOF
|
||||
description String? @db.Text
|
||||
currency String @default("XOF")
|
||||
description String?
|
||||
imageUrl String
|
||||
active Boolean @default(true)
|
||||
|
||||
// Relations
|
||||
businessId String
|
||||
business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model BlogPost {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
excerpt String @db.Text
|
||||
content String @db.Text
|
||||
author String
|
||||
excerpt String
|
||||
content String
|
||||
author String
|
||||
date DateTime @default(now())
|
||||
imageUrl String
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
enum InterviewType {
|
||||
VIDEO
|
||||
ARTICLE
|
||||
}
|
||||
|
||||
model Interview {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
@@ -113,35 +83,47 @@ model Interview {
|
||||
type InterviewType
|
||||
thumbnailUrl String
|
||||
videoUrl String?
|
||||
content String? @db.Text
|
||||
excerpt String @db.Text
|
||||
content String?
|
||||
excerpt String
|
||||
date DateTime @default(now())
|
||||
duration String? // "15 min" ou "5 min de lecture"
|
||||
|
||||
duration String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Comment {
|
||||
id String @id @default(uuid())
|
||||
content String @db.Text
|
||||
|
||||
// Relations
|
||||
authorId String
|
||||
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
||||
id String @id @default(uuid())
|
||||
content String
|
||||
authorId String
|
||||
businessId String
|
||||
business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
||||
business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model AnalyticsEvent {
|
||||
id String @id @default(uuid())
|
||||
type String // PAGE_VIEW, CLICK, DWELL_TIME
|
||||
type String
|
||||
path String
|
||||
label String? // For clicks (button text, link name)
|
||||
value Float? // For dwell time (seconds)
|
||||
metadata Json? // Browser, OS, etc.
|
||||
label String?
|
||||
value Float?
|
||||
metadata Json?
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
enum UserRole {
|
||||
VISITOR
|
||||
ENTREPRENEUR
|
||||
ADMIN
|
||||
}
|
||||
|
||||
enum OfferType {
|
||||
PRODUCT
|
||||
SERVICE
|
||||
}
|
||||
|
||||
enum InterviewType {
|
||||
VIDEO
|
||||
ARTICLE
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ async function main() {
|
||||
data: {
|
||||
id: b.id,
|
||||
name: b.name,
|
||||
slug: b.name.toLowerCase().replace(/[^a-z0-9]/g, '-'),
|
||||
category: b.category,
|
||||
location: b.location,
|
||||
description: b.description,
|
||||
|
||||
Reference in New Issue
Block a user