121 lines
2.6 KiB
Plaintext
121 lines
2.6 KiB
Plaintext
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
}
|
|
|
|
enum UserRole {
|
|
VISITOR
|
|
ENTREPRENEUR
|
|
ADMIN
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(uuid())
|
|
name String
|
|
email String @unique
|
|
role UserRole @default(VISITOR)
|
|
avatar String?
|
|
|
|
businesses Business[]
|
|
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
|
|
owner User @relation(fields: [ownerId], references: [id])
|
|
offers Offer[]
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|
|
|
|
enum OfferType {
|
|
PRODUCT
|
|
SERVICE
|
|
}
|
|
|
|
model Offer {
|
|
id String @id @default(uuid())
|
|
title String
|
|
type OfferType
|
|
price Float
|
|
currency String @default("XOF") // EUR or XOF
|
|
description String? @db.Text
|
|
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
|
|
}
|
|
|
|
model BlogPost {
|
|
id String @id @default(uuid())
|
|
title String
|
|
excerpt String @db.Text
|
|
content String @db.Text
|
|
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
|
|
guestName String
|
|
companyName String
|
|
role String
|
|
type InterviewType
|
|
thumbnailUrl String
|
|
videoUrl String?
|
|
content String? @db.Text
|
|
excerpt String @db.Text
|
|
date DateTime @default(now())
|
|
duration String? // "15 min" ou "5 min de lecture"
|
|
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
}
|