Spaces:
Build error
Build error
| // 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 | |
| email String | |
| name String? | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model Project { | |
| id String | |
| name String | |
| description String? | |
| style String | |
| status String | |
| createdAt DateTime | |
| updatedAt DateTime | |
| repos Repo[] | |
| analyses Analysis[] | |
| contents Content[] | |
| } | |
| model Repo { | |
| id String | |
| url String | |
| name String | |
| status String | |
| projectId String? | |
| project Project? | |
| analyses Analysis[] | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model Analysis { | |
| id String | |
| type String | |
| result String | |
| summary String? | |
| repoId String? | |
| repo Repo? | |
| projectId String? | |
| project Project? | |
| createdAt DateTime | |
| } | |
| model AgentTask { | |
| id String | |
| type String | |
| status String | |
| input String | |
| output String? | |
| createdAt DateTime | |
| completedAt DateTime? | |
| } | |
| // ============================================ | |
| // MODELOS DE CONTENIDO MULTIMEDIA | |
| // ============================================ | |
| model Content { | |
| id String | |
| type String // "image", "video", "audio", "text", "reel", "story", "carousel" | |
| title String | |
| description String? | |
| prompt String | |
| optimizedPrompt String? | |
| filePath String? | |
| thumbnail String? | |
| platform String | |
| status String | |
| metadata String? | |
| projectId String? | |
| project Project? | |
| characterId String? | |
| character Character? | |
| petId String? | |
| pet Pet? | |
| censorFlags CensorFlag[] | |
| posts Post[] | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model Character { | |
| id String | |
| name String | |
| description String? | |
| referenceImage String? | |
| traits String? | |
| contents Content[] | |
| pets Pet[] | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE CENSURA | |
| // ============================================ | |
| model CensorRule { | |
| id String | |
| platform String | |
| category String | |
| rule String | |
| severity String | |
| autoAction String | |
| isActive Boolean | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model CensorFlag { | |
| id String | |
| contentId String | |
| content Content | |
| category String | |
| reason String | |
| severity String | |
| action String | |
| createdAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE MONETIZACI脫N | |
| // ============================================ | |
| model MonetizationPlatform { | |
| id String | |
| 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 | |
| isVerified Boolean | |
| metadata String? | |
| posts Post[] | |
| earnings Earning[] | |
| subscribers Subscriber[] | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model Subscriber { | |
| id String | |
| platformId String | |
| platform MonetizationPlatform | |
| externalId String? | |
| username String? | |
| tier String? // Nivel de suscripci贸n | |
| status String // active, expired, cancelled | |
| joinedAt DateTime? | |
| expiresAt DateTime? | |
| totalSpent Float | |
| metadata String? | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model Earning { | |
| id String | |
| platformId String | |
| platform MonetizationPlatform | |
| type String // subscription, tip, ppv, referral | |
| amount Float | |
| currency String | |
| postId String? | |
| subscriberId String? | |
| status String // pending, processed, paid | |
| processedAt DateTime? | |
| metadata String? | |
| createdAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE PUBLICACI脫N | |
| // ============================================ | |
| model Post { | |
| id String | |
| title String? | |
| caption String? | |
| hashtags String? // JSON array | |
| type String // reel, photo, carousel, story, post | |
| status String // draft, scheduled, published, failed | |
| contentId String? | |
| content Content? | |
| platformId String? | |
| platform MonetizationPlatform? | |
| 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? | |
| metadata String? | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE STORYTELLING | |
| // ============================================ | |
| model Story { | |
| id String | |
| 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 | |
| currentEpisode Int | |
| status String // draft, active, completed, paused | |
| monetizationStrategy String? // JSON con estrategia de monetizaci贸n | |
| posts Post[] | |
| episodes StoryEpisode[] | |
| analytics StoryAnalytics? | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model StoryEpisode { | |
| id String | |
| storyId String | |
| story Story | |
| 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 | |
| scheduledAt DateTime? | |
| publishedAt DateTime? | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model StoryAnalytics { | |
| id String | |
| storyId String | |
| story Story | |
| totalViews Int | |
| totalEngagement Float | |
| avgWatchTime Float? // En segundos | |
| completionRate Float? // Porcentaje | |
| revenue Float | |
| subscriberGain Int | |
| bestPerformingEpisode Int? | |
| metadata String? | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE AUTOMATIZACI脫N | |
| // ============================================ | |
| model Automation { | |
| id String | |
| 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 | |
| lastRunAt DateTime? | |
| nextRunAt DateTime? | |
| runCount Int | |
| metadata String? | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model AutomationLog { | |
| id String | |
| automationId String? | |
| status String // success, failed, partial | |
| input String? | |
| output String? | |
| error String? | |
| duration Int? // Milisegundos | |
| createdAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE TENDENCIAS | |
| // ============================================ | |
| model Trend { | |
| id String | |
| 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 | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE PLANTILLAS | |
| // ============================================ | |
| model PromptTemplate { | |
| id String | |
| name String | |
| category String | |
| template String | |
| variables String | |
| platform String | |
| isActive Boolean | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| model ContentTemplate { | |
| id String | |
| 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 | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE MASCOTAS/COMPA脩EROS | |
| // ============================================ | |
| model Pet { | |
| id String | |
| 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? | |
| contents Content[] | |
| isActive Boolean | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE INFLUENCERS IA DE REFERENCIA | |
| // ============================================ | |
| model AIInfluencer { | |
| id String | |
| 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 | |
| petType String? | |
| analysis String? // JSON con an谩lisis detallado | |
| lessons String? // JSON con lecciones aprendidas | |
| isActive Boolean | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |
| // ============================================ | |
| // MODELOS DE ESTRATEGIAS VIRALES | |
| // ============================================ | |
| model ViralStrategy { | |
| id String | |
| 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 | |
| timeframe String? // Tiempo para viralizar | |
| examples String? // JSON con ejemplos | |
| tags String? // JSON array de tags | |
| successRate Float? | |
| isActive Boolean | |
| createdAt DateTime | |
| updatedAt DateTime | |
| } | |