130 lines
3.0 KiB
Plaintext
130 lines
3.0 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
}
|
|
|
|
model User {
|
|
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[]
|
|
}
|
|
|
|
model Business {
|
|
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 {
|
|
id String @id @default(uuid())
|
|
title String
|
|
type OfferType
|
|
price Float
|
|
currency String @default("XOF")
|
|
description String?
|
|
imageUrl String
|
|
active Boolean @default(true)
|
|
businessId String
|
|
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
|
|
content String
|
|
author String
|
|
date DateTime @default(now())
|
|
imageUrl String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Interview {
|
|
id String @id @default(uuid())
|
|
title String
|
|
guestName String
|
|
companyName String
|
|
role String
|
|
type InterviewType
|
|
thumbnailUrl String
|
|
videoUrl String?
|
|
content String?
|
|
excerpt String
|
|
date DateTime @default(now())
|
|
duration String?
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
model Comment {
|
|
id String @id @default(uuid())
|
|
content String
|
|
authorId String
|
|
businessId String
|
|
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
|
|
path String
|
|
label String?
|
|
value Float?
|
|
metadata Json?
|
|
createdAt DateTime @default(now())
|
|
}
|
|
|
|
enum UserRole {
|
|
VISITOR
|
|
ENTREPRENEUR
|
|
ADMIN
|
|
}
|
|
|
|
enum OfferType {
|
|
PRODUCT
|
|
SERVICE
|
|
}
|
|
|
|
enum InterviewType {
|
|
VIDEO
|
|
ARTICLE
|
|
}
|