platform-marketing-content/docs/04-modelado/MODELO-DOMINIO.md
rckrdmrd 74b5ed7f38 feat: Complete documentation update and orchestration configuration
- Update vision, architecture and technical documentation
- Update module definitions (PMC-001 to PMC-008)
- Update requirements documentation
- Add CONTEXT-MAP.yml and ENVIRONMENT-INVENTORY.yml
- Add orchestration guidelines and references

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 05:38:31 -06:00

23 KiB

id title type status project version created_date updated_date
MODELO-DOMINIO Modelo de Dominio - Platform Marketing Content Model Draft platform_marketing_content 1.0.0 2026-01-04 2026-01-04

Modelo de Dominio - Platform Marketing Content

Versión: 1.0.0 Fecha: 2025-12-08


Diagrama de Entidades

┌─────────────────────────────────────────────────────────────────────────────┐
│                              CORE ENTITIES                                   │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   ┌──────────┐         ┌──────────┐         ┌──────────┐                    │
│   │  Tenant  │◄────────│   Plan   │         │   User   │                    │
│   └────┬─────┘         └──────────┘         └────┬─────┘                    │
│        │                                          │                          │
│        │ 1:N                                      │ N:1                       │
│        ▼                                          ▼                          │
│   ┌──────────┐                              ┌──────────┐                     │
│   │  Client  │                              │   Role   │                     │
│   └────┬─────┘                              └──────────┘                     │
│        │                                                                     │
│        │ 1:N                                                                 │
│        ▼                                                                     │
│   ┌──────────┐         ┌──────────┐                                         │
│   │ Contact  │         │  Brand   │◄────────┐                               │
│   └──────────┘         └────┬─────┘         │                               │
│                             │               │ N:N                            │
│                             │ 1:N           │                               │
│                             ▼               │                               │
│                        ┌──────────┐    ┌────┴─────┐                         │
│                        │ Product  │    │CustomModel│                        │
│                        └──────────┘    └──────────┘                         │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────┐
│                           PROJECT ENTITIES                                   │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   ┌──────────┐                                                              │
│   │ Project  │◄──────────────────┐                                          │
│   └────┬─────┘                   │                                          │
│        │                         │ N:1 (Client)                              │
│        │ 1:N                     │                                          │
│        ▼                         │                                          │
│   ┌──────────┐         ┌─────────┴┐         ┌──────────┐                    │
│   │ Campaign │─────────│Opportunity│        │ BriefTpl │                    │
│   └────┬─────┘         └──────────┘         └──────────┘                    │
│        │                                                                     │
│        │ 1:N                                                                 │
│        ▼                                                                     │
│   ┌──────────────┐                                                          │
│   │CampaignAsset │──────────┐                                               │
│   └──────────────┘          │ N:1                                           │
│                             ▼                                               │
│                        ┌──────────┐                                         │
│                        │  Asset   │                                         │
│                        └──────────┘                                         │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────┐
│                         GENERATION ENTITIES                                  │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   ┌────────────────┐                   ┌────────────────┐                   │
│   │GenerationJob   │───────────────────│WorkflowTemplate│                   │
│   └───────┬────────┘                   └────────────────┘                   │
│           │                                                                  │
│           │ 1:N                                                              │
│           ▼                                                                  │
│   ┌────────────────┐                   ┌────────────────┐                   │
│   │     Asset      │                   │ TextGeneration │                   │
│   └───────┬────────┘                   └────────────────┘                   │
│           │                                                                  │
│           │ 1:N                                                              │
│           ▼                                                                  │
│   ┌────────────────┐                   ┌────────────────┐                   │
│   │  AssetVersion  │                   │  AssetComment  │                   │
│   └────────────────┘                   └────────────────┘                   │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────┐
│                         AUTOMATION ENTITIES                                  │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   ┌────────────────┐                   ┌────────────────┐                   │
│   │AutomationFlow  │───────────────────│ AutomationRun  │                   │
│   └───────┬────────┘                   └────────────────┘                   │
│           │                                                                  │
│           │ N:1                                                              │
│           ▼                                                                  │
│   ┌────────────────┐                                                        │
│   │WebhookEndpoint │                                                        │
│   └────────────────┘                                                        │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────┐
│                          SUPPORT ENTITIES                                    │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   ┌──────────┐    ┌──────────┐    ┌──────────┐    ┌──────────┐             │
│   │Collection│    │Invitation│    │ AuditLog │    │ Setting  │             │
│   └──────────┘    └──────────┘    └──────────┘    └──────────┘             │
│                                                                              │
│   ┌──────────┐    ┌──────────┐    ┌──────────┐                              │
│   │ Download │    │  Metric  │    │  Report  │                              │
│   └──────────┘    └──────────┘    └──────────┘                              │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Entidades por Módulo

PMC-001: Tenants

Entidad Descripción Relaciones Principales
Tenant Organización que usa la plataforma 1:N User, Client, Project, Asset
Plan Plan de suscripción con límites 1:N Tenant

PMC-002: CRM

Entidad Descripción Relaciones Principales
Client Empresa cliente de la agencia N:1 Tenant, 1:N Contact, Brand, Project
Contact Persona de contacto N:1 Client
Brand Marca con identidad visual N:1 Client, 1:N Product, Campaign
Product Producto o servicio N:1 Brand
Opportunity Oportunidad comercial N:1 Client, Contact

PMC-003: Projects

Entidad Descripción Relaciones Principales
Project Contenedor de campañas N:1 Client, Tenant, 1:N Campaign
Campaign Campaña de marketing con brief N:1 Project, Brand, 1:N CampaignAsset
CampaignAsset Relación campaña-asset con estado N:1 Campaign, Asset

PMC-004: Generation

Entidad Descripción Relaciones Principales
GenerationJob Tarea de generación N:1 Tenant, Campaign, WorkflowTemplate
WorkflowTemplate Plantilla de workflow ComfyUI 1:N GenerationJob
CustomModel LoRA/Checkpoint personalizado N:1 Tenant, Brand
TextGeneration Generación de texto/copy N:1 Tenant, GenerationJob

PMC-005: Automation

Entidad Descripción Relaciones Principales
AutomationFlow Definición de flujo automatizado N:1 Tenant, 1:N AutomationRun
AutomationRun Ejecución de un flujo N:1 AutomationFlow
WebhookEndpoint Endpoint para webhooks externos N:1 Tenant, AutomationFlow

PMC-006: Assets

Entidad Descripción Relaciones Principales
Asset Recurso digital (imagen, video, etc.) N:1 Tenant, GenerationJob
AssetVersion Versión histórica de asset N:1 Asset
Collection Agrupación de assets N:1 Tenant, N:N Asset
AssetComment Comentario sobre asset N:1 Asset, User
Download Registro de descarga N:1 Asset, User

PMC-007: Admin

Entidad Descripción Relaciones Principales
User Usuario del sistema N:1 Tenant, Role
Role Rol con permisos 1:N User
Invitation Invitación pendiente N:1 Tenant, Role
AuditLog Registro de auditoría N:1 Tenant, User
Setting Configuración del sistema N:1 Tenant (opcional)

PMC-008: Analytics

Entidad Descripción Relaciones Principales
Metric Dato métrico agregado N:1 Tenant
Report Reporte generado N:1 Tenant, User
SavedView Vista personalizada guardada N:1 Tenant, User

Matriz de Relaciones

             │Ten│Pln│Usr│Rol│Cli│Con│Bra│Pro│Opp│Prj│Cam│CAs│Job│Wfl│Mod│Txt│Flo│Run│Whk│Ast│Ver│Col│Com│Dwn│Inv│Aud│Set│Met│Rep│Viw│
─────────────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
Tenant       │   │N:1│1:N│   │1:N│   │   │   │   │1:N│   │   │1:N│   │1:N│   │1:N│   │1:N│1:N│   │1:N│   │   │1:N│1:N│1:N│1:N│1:N│1:N│
Plan         │1:N│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
User         │N:1│   │   │N:1│   │   │   │   │   │1:N│   │   │1:N│   │   │   │   │   │   │1:N│   │   │1:N│1:N│   │1:N│   │   │1:N│1:N│
Role         │   │   │1:N│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │1:N│   │   │   │   │   │
Client       │N:1│   │   │   │   │1:N│1:N│   │1:N│1:N│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
Contact      │   │   │   │   │N:1│   │   │   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
Brand        │   │   │   │   │N:1│   │   │1:N│   │   │1:N│   │   │   │N:N│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
Product      │   │   │   │   │   │   │N:1│   │   │   │   │   │N:1│   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
Opportunity  │   │   │   │   │N:1│N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
Project      │N:1│   │N:1│   │N:1│   │   │   │   │   │1:N│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
Campaign     │   │   │   │   │   │   │N:1│   │   │N:1│   │1:N│N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
CampaignAsset│   │   │   │   │   │   │   │   │   │   │N:1│   │   │   │   │   │   │   │   │N:1│   │   │   │   │   │   │   │   │   │   │
GenJob       │N:1│   │N:1│   │   │   │   │N:1│   │   │N:1│   │   │N:1│   │1:N│   │   │   │1:N│   │   │   │   │   │   │   │   │   │   │
Workflow     │   │   │   │   │   │   │   │   │   │   │   │   │1:N│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
CustomModel  │N:1│   │   │   │   │   │N:N│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
TextGen      │N:1│   │   │   │   │   │   │   │   │   │N:1│   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
AutoFlow     │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │1:N│1:N│   │   │   │   │   │   │   │   │   │   │   │
AutoRun      │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │
Webhook      │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │
Asset        │N:1│   │N:1│   │   │   │   │   │   │   │   │N:1│N:1│   │   │   │   │   │   │   │1:N│N:N│1:N│1:N│   │   │   │   │   │   │
AssetVer     │   │   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │N:1│   │   │   │   │   │   │   │   │   │   │
Collection   │N:1│   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │N:N│   │   │   │   │   │   │   │   │   │   │
AssetComment │   │   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │N:1│   │   │1:N│   │   │   │   │   │   │   │
Download     │N:1│   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │N:1│   │N:1│   │   │   │   │   │   │   │   │
Invitation   │N:1│   │N:1│N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
AuditLog     │N:1│   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
Setting      │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
Metric       │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
Report       │N:1│   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │
SavedView    │N:1│   │N:1│   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │   │

Agregados (DDD)

Aggregate: Tenant

  • Root: Tenant
  • Entities: Plan (referencia)
  • Value Objects: Settings, Branding, Limits

Aggregate: Client

  • Root: Client
  • Entities: Contact, Brand, Product
  • Value Objects: Identity (en Brand)

Aggregate: Project

  • Root: Project
  • Entities: Campaign, CampaignAsset
  • Value Objects: Brief (en Campaign)

Aggregate: Asset

  • Root: Asset
  • Entities: AssetVersion, AssetComment
  • Value Objects: Metadata, Dimensions

Aggregate: GenerationJob

  • Root: GenerationJob
  • Entities: (outputs referenciados)
  • Value Objects: InputParams, Progress

Aggregate: User

  • Root: User
  • Entities: (Role como referencia)
  • Value Objects: Preferences

Referencias


Documento generado por: Requirements-Analyst Fecha: 2025-12-08