import type {
  BrandPulse,
  Employee,
  Initiative,
  MarketingDataset,
  MarketingLocation,
  Meeting,
  SocialSnapshot,
  Task,
} from "@/lib/marketing/types";

export const marketingLocations: MarketingLocation[] = [
  { id: "mty-tampiquito", city: "mty", name: "Tampiquito" },
  { id: "mty-cordillera", city: "mty", name: "Cordillera" },
  { id: "mty-armida", city: "mty", name: "Armida" },
  { id: "mty-centro", city: "mty", name: "Centro" },
  { id: "mty-innovasport", city: "mty", name: "Innovasport" },
  { id: "mty-terminal-a", city: "mty", name: "Terminal A" },
  { id: "mty-terminal-b", city: "mty", name: "Terminal B" },
  { id: "mty-park-point", city: "mty", name: "Park point" },
  { id: "cdmx-roma-norte", city: "cdmx", name: "Roma norte" },
];

export const marketingEmployees: Employee[] = [
  {
    id: "emp-lead-mariana",
    name: "Mariana Flores",
    roleTitle: "Lider de Marketing",
    locationIds: marketingLocations.map((location) => location.id),
    isLead: true,
  },
  {
    id: "emp-carlos",
    name: "Carlos Mendez",
    roleTitle: "Especialista de Campanas",
    locationIds: ["mty-centro", "mty-cordillera", "mty-tampiquito"],
    isLead: false,
  },
  {
    id: "emp-paula",
    name: "Paula Trevino",
    roleTitle: "Community Manager",
    locationIds: ["mty-armida", "mty-park-point", "cdmx-roma-norte"],
    isLead: false,
  },
  {
    id: "emp-diego",
    name: "Diego Salinas",
    roleTitle: "Analista de Ads",
    locationIds: ["mty-terminal-a", "mty-terminal-b", "cdmx-roma-norte"],
    isLead: false,
  },
  {
    id: "emp-ana",
    name: "Ana Castro",
    roleTitle: "Relaciones Publicas",
    locationIds: ["mty-innovasport", "mty-cordillera", "mty-park-point"],
    isLead: false,
  },
];

export const marketingTasks: Task[] = [
  {
    id: "task-01",
    initiativeId: "init-01",
    title: "Coordinar pauta de lanzamiento",
    description: "Cierre de presupuesto y activacion local con gerentes de sucursal.",
    assigneeId: "emp-carlos",
    status: "done",
    dueDate: "2026-01-12",
    updatedAt: "2026-01-12",
    evidenceLinks: ["https://drive.google.com/bench-mkt/task-01"],
  },
  {
    id: "task-02",
    initiativeId: "init-01",
    title: "Publicaciones teaser",
    description: "Programar piezas teaser en IG/FB por 7 dias.",
    assigneeId: "emp-paula",
    status: "done",
    dueDate: "2026-01-15",
    updatedAt: "2026-01-15",
    evidenceLinks: ["https://drive.google.com/bench-mkt/task-02"],
  },
  {
    id: "task-03",
    initiativeId: "init-02",
    title: "Ajustar copy de brunch Roma",
    description: "Optimizar copy para audiencia oficinista entre semana.",
    assigneeId: "emp-paula",
    status: "in_progress",
    dueDate: "2026-02-22",
    updatedAt: "2026-02-16",
    evidenceLinks: ["https://drive.google.com/bench-mkt/task-03"],
  },
  {
    id: "task-04",
    initiativeId: "init-02",
    title: "Promocion con microinfluencers",
    description: "Cerrar 4 colaboraciones de contenido corto.",
    assigneeId: "emp-ana",
    status: "todo",
    dueDate: "2026-02-24",
    updatedAt: "2026-02-17",
    evidenceLinks: [],
  },
  {
    id: "task-05",
    initiativeId: "init-03",
    title: "Registrar base de leads",
    description: "Consolidar leads levantados durante colaboracion.",
    assigneeId: "emp-carlos",
    status: "done",
    dueDate: "2026-01-31",
    updatedAt: "2026-02-02",
    evidenceLinks: ["https://drive.google.com/bench-mkt/task-05"],
  },
  {
    id: "task-06",
    initiativeId: "init-04",
    title: "Segmentacion viajeros frecuentes",
    description: "Crear segmentos por horario de vuelo y ticket promedio.",
    assigneeId: "emp-diego",
    status: "in_progress",
    dueDate: "2026-02-20",
    updatedAt: "2026-02-17",
    evidenceLinks: ["https://drive.google.com/bench-mkt/task-06"],
  },
  {
    id: "task-07",
    initiativeId: "init-04",
    title: "Landing para cupon terminal",
    description: "Publicar landing para canje de promo en ambas terminales.",
    assigneeId: "emp-carlos",
    status: "todo",
    dueDate: "2026-02-26",
    updatedAt: "2026-02-16",
    evidenceLinks: [],
  },
  {
    id: "task-08",
    initiativeId: "init-05",
    title: "Difusion medios locales",
    description: "Enviar comunicado y coordinar entrevistas.",
    assigneeId: "emp-ana",
    status: "done",
    dueDate: "2026-01-20",
    updatedAt: "2026-01-21",
    evidenceLinks: ["https://drive.google.com/bench-mkt/task-08"],
  },
  {
    id: "task-09",
    initiativeId: "init-06",
    title: "Bundle romantico",
    description: "Definir bundle y pricing por sucursal.",
    assigneeId: "emp-carlos",
    status: "done",
    dueDate: "2026-02-03",
    updatedAt: "2026-02-03",
    evidenceLinks: ["https://drive.google.com/bench-mkt/task-09"],
  },
  {
    id: "task-10",
    initiativeId: "init-07",
    title: "Plan logistica degustacion",
    description: "Inventario, personal y flujo de invitados.",
    assigneeId: "emp-ana",
    status: "todo",
    dueDate: "2026-03-10",
    updatedAt: "2026-02-17",
    evidenceLinks: [],
  },
  {
    id: "task-11",
    initiativeId: "init-08",
    title: "Creatividades de recompra",
    description: "Desarrollar 6 variaciones de arte para retargeting.",
    assigneeId: "emp-diego",
    status: "in_progress",
    dueDate: "2026-02-25",
    updatedAt: "2026-02-16",
    evidenceLinks: ["https://drive.google.com/bench-mkt/task-11"],
  },
  {
    id: "task-12",
    initiativeId: "init-09",
    title: "Activacion en club corporativo",
    description: "Coordinar dinamica con aliados de bienestar.",
    assigneeId: "emp-paula",
    status: "done",
    dueDate: "2026-02-08",
    updatedAt: "2026-02-08",
    evidenceLinks: ["https://drive.google.com/bench-mkt/task-12"],
  },
  {
    id: "task-13",
    initiativeId: "init-10",
    title: "Calendario de PR estacional",
    description: "Definir mensajes de temporada y voceros por ciudad.",
    assigneeId: "emp-ana",
    status: "todo",
    dueDate: "2026-03-21",
    updatedAt: "2026-02-17",
    evidenceLinks: [],
  },
  {
    id: "task-14",
    initiativeId: "init-10",
    title: "Brief de fotografia",
    description: "Organizar sesion para nuevos productos de primavera.",
    assigneeId: "emp-paula",
    status: "todo",
    dueDate: "2026-03-24",
    updatedAt: "2026-02-17",
    evidenceLinks: [],
  },
];

export const marketingInitiatives: Initiative[] = [
  {
    id: "init-01",
    name: "Festival de Rosca MTY",
    type: "evento",
    status: "completion",
    isGlobal: false,
    locationIds: ["mty-centro", "mty-armida"],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-carlos", "emp-paula"],
    dueDate: "2026-01-20",
    completedAt: "2026-01-19",
    importanceWeight: 1.3,
    leadRating1to5: 4,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 100,
      actual: 95,
      ticketsTarget: 100,
      ticketsActual: 95,
      revenueTarget: 185000,
      revenueActual: 176500,
    },
    retro: {
      opinionPublica: "positive",
      queFunciono: "Las alianzas con oficinas cercanas elevaron conversion en lunch.",
      queNo: "El inventario del segundo fin de semana quedo corto.",
      proximoIntento: "Ajustar forecast con historial de fines de semana largos.",
    },
    evidenceLinks: ["https://drive.google.com/bench-mkt/init-01-report"],
    taskIds: ["task-01", "task-02"],
  },
  {
    id: "init-02",
    name: "Campania Roma Norte Brunch",
    type: "campania",
    status: "in_progress",
    isGlobal: false,
    locationIds: ["cdmx-roma-norte"],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-paula", "emp-ana"],
    dueDate: "2026-03-05",
    completedAt: null,
    importanceWeight: 1.4,
    leadRating1to5: 4,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 320000,
      actual: 188000,
      ticketsTarget: 920,
      ticketsActual: 560,
      revenueTarget: 320000,
      revenueActual: 188000,
    },
    retro: {
      opinionPublica: "mixed",
      queFunciono: "Buen CTR en reels de menu matutino.",
      queNo: "Poca conversion en horario de tarde.",
      proximoIntento: "Separar mensajes para semana laboral vs fin de semana.",
    },
    evidenceLinks: ["https://drive.google.com/bench-mkt/init-02-dashboard"],
    taskIds: ["task-03", "task-04"],
  },
  {
    id: "init-03",
    name: "Colaboracion Run Club Armida",
    type: "implementacion",
    status: "evaluation",
    isGlobal: false,
    locationIds: ["mty-armida"],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-carlos"],
    dueDate: "2026-01-31",
    completedAt: "2026-02-02",
    importanceWeight: 0.9,
    leadRating1to5: 3,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 180,
      actual: 162,
      ticketsTarget: 180,
      ticketsActual: 162,
      revenueTarget: 96000,
      revenueActual: 84800,
    },
    retro: {
      opinionPublica: "mixed",
      queFunciono: "La dinamica post-carrera aumento menciones organicas.",
      queNo: "Registro manual de asistentes genero friccion.",
      proximoIntento: "Usar QR para pre-registro en sitio.",
    },
    evidenceLinks: ["https://drive.google.com/bench-mkt/init-03-retro"],
    taskIds: ["task-05"],
  },
  {
    id: "init-04",
    name: "Ads Terminales Viajeros",
    type: "campania",
    status: "in_progress",
    isGlobal: false,
    locationIds: ["mty-terminal-a", "mty-terminal-b"],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-diego", "emp-carlos"],
    dueDate: "2026-03-15",
    completedAt: null,
    importanceWeight: 1.2,
    leadRating1to5: 4,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 240000,
      actual: 121000,
      ticketsTarget: 700,
      ticketsActual: 358,
      revenueTarget: 240000,
      revenueActual: 121000,
    },
    retro: {
      opinionPublica: "positive",
      queFunciono: "Campanas por horario tuvieron mejor ROAS matutino.",
      queNo: "Creativo vespertino bajo desempeno.",
      proximoIntento: "Rotar artes cada 72 horas con pruebas A/B.",
    },
    evidenceLinks: ["https://drive.google.com/bench-mkt/init-04-ads"],
    taskIds: ["task-06", "task-07"],
  },
  {
    id: "init-05",
    name: "PR Pan de Masa Madre",
    type: "cambio",
    status: "evaluation",
    isGlobal: false,
    locationIds: ["mty-cordillera", "mty-park-point"],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-ana"],
    dueDate: "2026-01-28",
    completedAt: "2026-01-27",
    importanceWeight: 1.1,
    leadRating1to5: 5,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 120,
      actual: 138,
      ticketsTarget: 120,
      ticketsActual: 138,
      revenueTarget: 128000,
      revenueActual: 142600,
    },
    retro: {
      opinionPublica: "positive",
      queFunciono: "Cobertura de prensa local aumento trafico de fin de semana.",
      queNo: "Se saturaron respuestas manuales en redes.",
      proximoIntento: "Publicar FAQ en historias destacadas para absorcion.",
    },
    evidenceLinks: ["https://drive.google.com/bench-mkt/init-05-pr"],
    taskIds: ["task-08"],
  },
  {
    id: "init-06",
    name: "Campania San Valentin Tampiquito",
    type: "campania",
    status: "completion",
    isGlobal: false,
    locationIds: ["mty-tampiquito"],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-carlos"],
    dueDate: "2026-02-14",
    completedAt: "2026-02-13",
    importanceWeight: 1.2,
    leadRating1to5: 4,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 260000,
      actual: 254000,
      ticketsTarget: 760,
      ticketsActual: 742,
      revenueTarget: 260000,
      revenueActual: 254000,
    },
    retro: {
      opinionPublica: "positive",
      queFunciono: "Bundles con cafe incrementaron ticket promedio.",
      queNo: "Inventario de temporada se agoto antes del cierre.",
      proximoIntento: "Agregar reposicion rapida para top sellers.",
    },
    evidenceLinks: ["https://drive.google.com/bench-mkt/init-06-report"],
    taskIds: ["task-09"],
  },
  {
    id: "init-07",
    name: "Evento Degustacion Cordillera",
    type: "evento",
    status: "planning",
    isGlobal: false,
    locationIds: ["mty-cordillera"],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-ana", "emp-paula"],
    dueDate: "2026-03-22",
    completedAt: null,
    importanceWeight: 0.8,
    leadRating1to5: 3,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 160,
      actual: 0,
      ticketsTarget: 160,
      ticketsActual: 0,
      revenueTarget: 112000,
      revenueActual: 0,
    },
    retro: {
      opinionPublica: "mixed",
      queFunciono: "N/A",
      queNo: "N/A",
      proximoIntento: "Definir guion y experiencia sensorial por estaciones.",
    },
    evidenceLinks: [],
    taskIds: ["task-10"],
  },
  {
    id: "init-08",
    name: "Ads Recompra Q1",
    type: "campania",
    status: "in_progress",
    isGlobal: true,
    locationIds: [],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-diego"],
    dueDate: "2026-03-31",
    completedAt: null,
    importanceWeight: 1.4,
    leadRating1to5: 4,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 410000,
      actual: 219000,
      ticketsTarget: 1160,
      ticketsActual: 620,
      revenueTarget: 410000,
      revenueActual: 219000,
    },
    retro: {
      opinionPublica: "mixed",
      queFunciono: "Retargeting a clientes de alta frecuencia mantiene conversion.",
      queNo: "Frecuencia de impresiones elevada en audiencia pequena.",
      proximoIntento: "Expandir lookalikes y actualizar exclusiones semanalmente.",
    },
    evidenceLinks: ["https://drive.google.com/bench-mkt/init-08-ads"],
    taskIds: ["task-11"],
  },
  {
    id: "init-09",
    name: "Colaboracion Innovasport Corporate",
    type: "implementacion",
    status: "completion",
    isGlobal: false,
    locationIds: ["mty-innovasport"],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-paula"],
    dueDate: "2026-02-10",
    completedAt: "2026-02-09",
    importanceWeight: 1,
    leadRating1to5: 4,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 140,
      actual: 151,
      ticketsTarget: 140,
      ticketsActual: 151,
      revenueTarget: 98000,
      revenueActual: 107300,
    },
    retro: {
      opinionPublica: "positive",
      queFunciono: "El convenio con area corporativa acelero ventas de paquete.",
      queNo: "Poca claridad en terminos del beneficio para repeticion.",
      proximoIntento: "Incluir mecanica de recompra desde dia 1.",
    },
    evidenceLinks: ["https://drive.google.com/bench-mkt/init-09-retro"],
    taskIds: ["task-12"],
  },
  {
    id: "init-10",
    name: "PR Concha Rellena Primavera",
    type: "cambio",
    status: "planning",
    isGlobal: false,
    locationIds: ["mty-park-point", "cdmx-roma-norte"],
    ownerId: "emp-lead-mariana",
    contributorIds: ["emp-ana", "emp-paula"],
    dueDate: "2026-04-12",
    completedAt: null,
    importanceWeight: 1,
    leadRating1to5: 3,
    metricSelection: {
      score: true,
      tickets: true,
      revenue: true,
    },
    metrics: {
      target: 200,
      actual: 0,
      ticketsTarget: 200,
      ticketsActual: 0,
      revenueTarget: 152000,
      revenueActual: 0,
    },
    retro: {
      opinionPublica: "mixed",
      queFunciono: "N/A",
      queNo: "N/A",
      proximoIntento: "Alinear voceria y disponibilidad en punto de venta.",
    },
    evidenceLinks: [],
    taskIds: ["task-13", "task-14"],
  },
];

export const marketingSocialSnapshots: SocialSnapshot[] = [
  {
    id: "social-ig-7d",
    channel: "instagram",
    range: "7d",
    followersStart: 42180,
    followersEnd: 42790,
    engagementRate: 5.8,
    reach: 186400,
    impressions: 251000,
    capturedAt: "2026-02-17",
  },
  {
    id: "social-fb-7d",
    channel: "facebook",
    range: "7d",
    followersStart: 31120,
    followersEnd: 31410,
    engagementRate: 3.9,
    reach: 132000,
    impressions: 176500,
    capturedAt: "2026-02-17",
  },
  {
    id: "social-ig-30d",
    channel: "instagram",
    range: "30d",
    followersStart: 39840,
    followersEnd: 42790,
    engagementRate: 5.3,
    reach: 612000,
    impressions: 841300,
    capturedAt: "2026-02-17",
  },
  {
    id: "social-fb-30d",
    channel: "facebook",
    range: "30d",
    followersStart: 29860,
    followersEnd: 31410,
    engagementRate: 3.6,
    reach: 452000,
    impressions: 639800,
    capturedAt: "2026-02-17",
  },
];

export const marketingBrandPulse: BrandPulse = {
  id: "brand-pulse-2026-02",
  month: "2026-02",
  rating1to5: 4,
  notes: "Percepcion de marca estable; comentarios positivos por consistencia en producto y servicio.",
  updatedAt: "2026-02-12",
  updatedById: "emp-lead-mariana",
};

export const marketingMeetings: Meeting[] = [
  {
    id: "meet-01",
    title: "Revision semanal de campanas",
    status: "scheduled",
    agenda: "Avances por sucursal, desviaciones de presupuesto y prioridades de la semana.",
    requestedById: "emp-lead-mariana",
    participantNames: ["Mariana Flores", "Carlos Mendez", "Paula Trevino", "Diego Salinas"],
    suggestedTimes: [],
    scheduledFor: "2026-02-19T10:00:00-06:00",
    completedAt: null,
    commitments: [],
  },
  {
    id: "meet-02",
    title: "Solicitud 1:1 de Creatividades",
    status: "requested",
    agenda: "Feedback sobre ejecucion de piezas de Terminales.",
    requestedById: "emp-paula",
    participantNames: ["Paula Trevino", "Mariana Flores"],
    suggestedTimes: [
      "2026-02-20T12:00:00-06:00",
      "2026-02-20T16:00:00-06:00",
      "2026-02-21T11:30:00-06:00",
    ],
    scheduledFor: null,
    completedAt: null,
    commitments: [],
  },
  {
    id: "meet-03",
    title: "Retro Concha temporada",
    status: "completed",
    agenda: "Lecciones aprendidas de la activacion de temporada y ajustes de inventario.",
    requestedById: "emp-lead-mariana",
    participantNames: ["Mariana Flores", "Ana Castro", "Carlos Mendez"],
    suggestedTimes: [],
    scheduledFor: "2026-02-11T09:00:00-06:00",
    completedAt: "2026-02-11T10:10:00-06:00",
    commitments: [
      {
        id: "commitment-01",
        title: "Definir calendario estacional",
        description: "Entregar version consolidada para direccion.",
        ownerName: "Ana Castro",
        dueDate: "2026-03-21",
        status: "pendiente",
      },
      {
        id: "commitment-02",
        title: "Cerrar brief de fotografia",
        description: "Validar tomas y locaciones para lanzamiento.",
        ownerName: "Paula Trevino",
        dueDate: "2026-03-24",
        status: "pendiente",
      },
    ],
  },
  {
    id: "meet-04",
    title: "Revision mensual con Direccion",
    status: "scheduled",
    agenda: "Resumen KPI marketing, score del departamento y riesgos del siguiente mes.",
    requestedById: "emp-lead-mariana",
    participantNames: ["Mariana Flores", "Chuy"],
    suggestedTimes: [],
    scheduledFor: "2026-02-26T08:30:00-06:00",
    completedAt: null,
    commitments: [],
  },
];

export const marketingMockData: MarketingDataset = {
  locations: marketingLocations,
  employees: marketingEmployees,
  initiatives: marketingInitiatives,
  tasks: marketingTasks,
  meetings: marketingMeetings,
  socialSnapshots: marketingSocialSnapshots,
  brandPulse: marketingBrandPulse,
};
