Spaces:
Build error
Build error
File size: 14,281 Bytes
333c51a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 | // This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
// ============================================
// MODELOS BASE
// ============================================
model User {
id String @id @default(cuid())
email String @unique
name String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Project {
id String @id @default(cuid())
name String
description String?
style String @default("default")
status String @default("active")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
repos Repo[]
analyses Analysis[]
contents Content[]
}
model Repo {
id String @id @default(cuid())
url String
name String
status String @default("cloned")
projectId String?
project Project? @relation(fields: [projectId], references: [id])
analyses Analysis[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Analysis {
id String @id @default(cuid())
type String
result String
summary String?
repoId String?
repo Repo? @relation(fields: [repoId], references: [id])
projectId String?
project Project? @relation(fields: [projectId], references: [id])
createdAt DateTime @default(now())
}
model AgentTask {
id String @id @default(cuid())
type String
status String @default("pending")
input String
output String?
createdAt DateTime @default(now())
completedAt DateTime?
}
// ============================================
// MODELOS DE CONTENIDO MULTIMEDIA
// ============================================
model Content {
id String @id @default(cuid())
type String // "image", "video", "audio", "text", "reel", "story", "carousel"
title String
description String?
prompt String
optimizedPrompt String?
filePath String?
thumbnail String?
platform String @default("general")
status String @default("pending")
metadata String?
projectId String?
project Project? @relation(fields: [projectId], references: [id])
characterId String?
character Character? @relation(fields: [characterId], references: [id])
petId String?
pet Pet? @relation(fields: [petId], references: [id])
censorFlags CensorFlag[]
posts Post[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Character {
id String @id @default(cuid())
name String
description String?
referenceImage String?
traits String?
contents Content[]
pets Pet[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ============================================
// MODELOS DE CENSURA
// ============================================
model CensorRule {
id String @id @default(cuid())
platform String
category String
rule String
severity String @default("medium")
autoAction String @default("warn")
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model CensorFlag {
id String @id @default(cuid())
contentId String
content Content @relation(fields: [contentId], references: [id])
category String
reason String
severity String
action String
createdAt DateTime @default(now())
}
// ============================================
// MODELOS DE MONETIZACI脫N
// ============================================
model MonetizationPlatform {
id String @id @default(cuid())
name String // OnlyFans, Patreon, Fansly, etc.
type String // "subscription", "tips", "ppv", "mixed"
url String?
apiKey String? // Encriptado
accountId String?
accountName String?
legalTerms String? // JSON con t茅rminos legales
contentRules String? // JSON con reglas de contenido
feePercentage Float?
payoutSchedule String?
isActive Boolean @default(true)
isVerified Boolean @default(false)
metadata String?
posts Post[]
earnings Earning[]
subscribers Subscriber[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Subscriber {
id String @id @default(cuid())
platformId String
platform MonetizationPlatform @relation(fields: [platformId], references: [id])
externalId String?
username String?
tier String? // Nivel de suscripci贸n
status String @default("active") // active, expired, cancelled
joinedAt DateTime?
expiresAt DateTime?
totalSpent Float @default(0)
metadata String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Earning {
id String @id @default(cuid())
platformId String
platform MonetizationPlatform @relation(fields: [platformId], references: [id])
type String // subscription, tip, ppv, referral
amount Float
currency String @default("USD")
postId String?
subscriberId String?
status String @default("pending") // pending, processed, paid
processedAt DateTime?
metadata String?
createdAt DateTime @default(now())
}
// ============================================
// MODELOS DE PUBLICACI脫N
// ============================================
model Post {
id String @id @default(cuid())
title String?
caption String?
hashtags String? // JSON array
type String // reel, photo, carousel, story, post
status String @default("draft") // draft, scheduled, published, failed
contentId String?
content Content? @relation(fields: [contentId], references: [id])
platformId String?
platform MonetizationPlatform? @relation(fields: [platformId], references: [id])
scheduledAt DateTime?
publishedAt DateTime?
externalPostId String? // ID en la plataforma externa
postUrl String? // URL del post publicado
engagementStats String? // JSON con likes, views, shares, etc.
storyId String?
story Story? @relation(fields: [storyId], references: [id])
metadata String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ============================================
// MODELOS DE STORYTELLING
// ============================================
model Story {
id String @id @default(cuid())
title String
description String?
genre String? // romance, drama, comedy, thriller, etc.
targetAudience String? // Demograf铆a objetivo
tone String? // romantic, funny, dramatic, mysterious
structure String? // JSON con estructura narrativa
characterIds String? // JSON array de IDs de personajes
totalEpisodes Int @default(1)
currentEpisode Int @default(1)
status String @default("draft") // draft, active, completed, paused
monetizationStrategy String? // JSON con estrategia de monetizaci贸n
posts Post[]
episodes StoryEpisode[]
analytics StoryAnalytics?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model StoryEpisode {
id String @id @default(cuid())
storyId String
story Story @relation(fields: [storyId], references: [id])
episodeNum Int
title String
synopsis String?
content String // Gui贸n o descripci贸n detallada
hook String? // Gancho para la siguiente episodio
cliffhanger String?
status String @default("draft")
scheduledAt DateTime?
publishedAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model StoryAnalytics {
id String @id @default(cuid())
storyId String @unique
story Story @relation(fields: [storyId], references: [id])
totalViews Int @default(0)
totalEngagement Float @default(0)
avgWatchTime Float? // En segundos
completionRate Float? // Porcentaje
revenue Float @default(0)
subscriberGain Int @default(0)
bestPerformingEpisode Int?
metadata String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ============================================
// MODELOS DE AUTOMATIZACI脫N
// ============================================
model Automation {
id String @id @default(cuid())
name String
description String?
type String // content_generation, posting, engagement, monetization
trigger String // schedule, event, manual, webhook
triggerConfig String? // JSON con configuraci贸n del trigger
actions String // JSON array de acciones a ejecutar
isActive Boolean @default(true)
lastRunAt DateTime?
nextRunAt DateTime?
runCount Int @default(0)
metadata String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model AutomationLog {
id String @id @default(cuid())
automationId String?
status String // success, failed, partial
input String?
output String?
error String?
duration Int? // Milisegundos
createdAt DateTime @default(now())
}
// ============================================
// MODELOS DE TENDENCIAS
// ============================================
model Trend {
id String @id @default(cuid())
platform String
type String // hashtag, sound, challenge, topic
name String
description String?
volume Int?
growth Float?
startDate DateTime?
endDate DateTime?
relatedTags String? // JSON array
contentIdeas String? // JSON con ideas de contenido
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ============================================
// MODELOS DE PLANTILLAS
// ============================================
model PromptTemplate {
id String @id @default(cuid())
name String
category String
template String
variables String
platform String @default("general")
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model ContentTemplate {
id String @id @default(cuid())
name String
type String // reel, carousel, story, post
platform String
structure String // JSON con estructura del contenido
hooks String? // JSON array de ganchos
ctas String? // JSON array de call-to-actions
hashtags String? // JSON array de hashtags
bestTimes String? // JSON con mejores horarios
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ============================================
// MODELOS DE MASCOTAS/COMPA脩EROS
// ============================================
model Pet {
id String @id @default(cuid())
name String
type String // dog, cat, bird, etc.
breed String?
description String?
referenceImage String?
traits String? // JSON con caracter铆sticas
personality String? // playful, calm, energetic
color String?
accessories String? // JSON array de accesorios
characterId String?
character Character? @relation(fields: [characterId], references: [id], onDelete: Cascade)
contents Content[]
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ============================================
// MODELOS DE INFLUENCERS IA DE REFERENCIA
// ============================================
model AIInfluencer {
id String @id @default(cuid())
name String
handle String?
platform String
followers Int?
engagement Float?
niche String?
style String? // JSON con estilo de contenido
contentTypes String? // JSON array de tipos de contenido
postingSchedule String? // JSON con horarios
visualStyle String? // JSON con estilo visual
monetizationType String? // JSON con tipo de monetizaci贸n
signatureElements String? // JSON con elementos distintivos
petCompanion Boolean @default(false)
petType String?
analysis String? // JSON con an谩lisis detallado
lessons String? // JSON con lecciones aprendidas
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
// ============================================
// MODELOS DE ESTRATEGIAS VIRALES
// ============================================
model ViralStrategy {
id String @id @default(cuid())
name String
description String?
platform String
contentType String // reel, post, story, carousel
hook String? // Gancho inicial
structure String? // JSON con estructura viral
elements String? // JSON con elementos clave
estimatedReach Int?
difficulty String @default("medium")
timeframe String? // Tiempo para viralizar
examples String? // JSON con ejemplos
tags String? // JSON array de tags
successRate Float?
isActive Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
|