import type { DepartmentKey } from "@/lib/types";

export type WeeklyKpiBaselineRow = {
  responsibility: string;
  objectiveIndicator?: string;
  quantityQuality?: string;
  compliance?: string;
  dueCommitment?: string;
};

export type WeeklyKpiBaselineSection = {
  sectionKey: string;
  rawSectionLabel: string;
  mappedDepartment: DepartmentKey | null;
  ownerTeamLabel?: string | null;
  rows: WeeklyKpiBaselineRow[];
};

export const KPI_BASELINE_WEEK_START = "2026-03-16";
export const KPI_BASELINE_WEEK_END = "2026-03-22";
export const KPI_BASELINE_SOURCE = "pdf-kpi-breakdown-2026-03-18";

export const WEEKLY_KPI_BASELINE_SECTIONS: WeeklyKpiBaselineSection[] = [
  {
    sectionKey: "administracion-1",
    rawSectionLabel: "ADMINISTRACION",
    mappedDepartment: "capital_humano",
    ownerTeamLabel: "EQUIPO",
    rows: [
      { responsibility: "CUMPLIMIENTO PROCESOS KPIS", objectiveIndicator: "90% PROMEDIO GENERAL" },
    ],
  },
  {
    sectionKey: "primitivo-v-2",
    rawSectionLabel: "PRIMITIVO V.",
    mappedDepartment: "capital_humano",
    ownerTeamLabel: "JOB",
    rows: [
      { responsibility: "RESULTADOS EN TIEMPO Y FORMA" },
      { responsibility: "% MARGEN Y GASTOS OPERATIVOS", objectiveIndicator: "22% MARGEN 22% GASTO CASAS" },
      { responsibility: "FLUJOS CXC Y CXP", objectiveIndicator: "EN ORDEN Y EFICIENTE" },
      { responsibility: "LEGAL Y FISCAL TIEMPO Y FORMA", objectiveIndicator: "OPTIMIZACION Y EXPEDIENTE" },
      { responsibility: "ARCHIVO ACTUALIZADO (PERMISOS)", objectiveIndicator: "EXPEDIENTE" },
      { responsibility: "SEGUIMIENTO DE PPTOS", objectiveIndicator: "PLAN" },
      { responsibility: "EXPEDIENTE LEGAL, FINANCIERO, FISCAL", objectiveIndicator: "EN ORDEN" },
      { responsibility: "CONCILIACION DE INGRESOS", quantityQuality: "100%" },
      { responsibility: "CEDULA DE PASIVOS EN FLUJO AUTOMATIZADA", quantityQuality: "100%" },
      { responsibility: "ESTRATEGIA DE EGRESOS", objectiveIndicator: "PLAN" },
      { responsibility: "FLUJOS POSITIVOS", quantityQuality: "50%" },
      { responsibility: "PROVISIONES", objectiveIndicator: "PLAN" },
      { responsibility: "PPTO FLUJO ANUAL", quantityQuality: "50%" },
      { responsibility: "ORDEN Y NOMENCLATURA EN CUENTAS BANCARIAS", objectiveIndicator: "PLAN 50%" },
      { responsibility: "COSTOS", quantityQuality: "32%" },
      { responsibility: "FACTURACION TOTAL", quantityQuality: "100%" },
    ],
  },
  {
    sectionKey: "capital-humano-3",
    rawSectionLabel: "CAPITAL HUMANO",
    mappedDepartment: "capital_humano",
    ownerTeamLabel: "PRIMITIVO V.",
    rows: [
      { responsibility: "POLITICAS, PROCESOS, REGLAMENTOS", objectiveIndicator: "PLAN" },
      { responsibility: "TODO FIRMADO Y EN ORDEN", quantityQuality: "90%" },
      { responsibility: "GESTION OPTIMA DE IMPUESTOS", objectiveIndicator: "PLAN" },
      { responsibility: "CULTURA, UNIFORMES, BOY SCOUTS", objectiveIndicator: "PLAN" },
      { responsibility: "GESTION DE CAPACITACION", objectiveIndicator: "PLAN" },
      { responsibility: "COMUNICACIÓN INTERNA", objectiveIndicator: "CON AYUDA DE CHUY Y RAQUEL 30%" },
      { responsibility: "PLAN DE CARRERA (GERENTES Y COORDINADORES)", objectiveIndicator: "1 AREA" },
      { responsibility: "CONTROL DE NOMINA Y HORAS EXTRAS", objectiveIndicator: "22% CON IMPUESTOS , PLAN DE EXTRAS" },
    ],
  },
  {
    sectionKey: "aprendizaje-4",
    rawSectionLabel: "APRENDIZAJE",
    mappedDepartment: "capital_humano",
    ownerTeamLabel: "LIBROS Y CURSOS Y GENTE",
    rows: [
      { responsibility: "1 LIBRO y 5 REELS ó 1 CURSO" },
    ],
  },
  {
    sectionKey: "implementaciones-5",
    rawSectionLabel: "IMPLEMENTACIONES",
    mappedDepartment: "capital_humano",
    ownerTeamLabel: "SISTEMAS Y DOCUMENTOS CLAUDE",
    rows: [
      { responsibility: "1 SISTEMA INNOVADOR" },
    ],
  },
  {
    sectionKey: "compras-6",
    rawSectionLabel: "COMPRAS",
    mappedDepartment: "operaciones",
    ownerTeamLabel: "VICTOR S.",
    rows: [
      { responsibility: "COMUNICACIÓN PROVEEDORES", quantityQuality: "100%" },
      { responsibility: "PRESUPUESTO MENSUAL, ANUAL", quantityQuality: "50%" },
      { responsibility: "% DE COSTO UNIDADES", quantityQuality: "32%" },
      { responsibility: "% DE COSTO CEDIS", quantityQuality: "80%" },
      { responsibility: "MANEJO DE DEUDA %", objectiveIndicator: "ACTUALIZACION Y REDUCCION 10%" },
      { responsibility: "EQUIPO Y PRODUCTOS ESPECIALES", objectiveIndicator: "PLAN ANUAL CON CHUY" },
    ],
  },
  {
    sectionKey: "mantenimiento-7",
    rawSectionLabel: "MANTENIMIENTO",
    mappedDepartment: "operaciones",
    ownerTeamLabel: "VICTOR S.",
    rows: [
      { responsibility: "PREVENTIVOS CALENDARIO Y CUMPLIMIENTO", quantityQuality: "100%" },
      { responsibility: "PRESUPUESTO MENSUAL, ANUAL", quantityQuality: "50%" },
      { responsibility: "MOBILIARIO, INFRAESTRUCTURA, EQUIPO, AUTOS", objectiveIndicator: "PLAN" },
      { responsibility: "EQUIPOS ESPECIALES, EVENTOS", objectiveIndicator: "PLAN" },
    ],
  },
  {
    sectionKey: "cedis-8",
    rawSectionLabel: "CEDIS",
    mappedDepartment: "operaciones",
    ownerTeamLabel: "VICTOR S.",
    rows: [
      { responsibility: "ORGANIGRAMA FUNCIONAL", quantityQuality: "100%" },
      { responsibility: "AGENDA Y LOGISTICA", quantityQuality: "100%" },
      { responsibility: "COMUNICACIÓN CON GERENTES", quantityQuality: "100%" },
      { responsibility: "ORDEN, PEPS, CLARIDAD Y CONTROL INVENTARIOS", objectiveIndicator: "50% Y PLAN" },
      { responsibility: "POLITICAS DE RECIBO Y ENTREGA", quantityQuality: "100%" },
      { responsibility: "LOGISTICA VISIBLE Y ENTREGA PERFECTA", quantityQuality: "95%" },
    ],
  },
  {
    sectionKey: "aprendizaje-9",
    rawSectionLabel: "APRENDIZAJE",
    mappedDepartment: "operaciones",
    ownerTeamLabel: "LIBROS Y CURSOS Y GENTE",
    rows: [
      { responsibility: "1 LIBRO y 5 REELS ó 1 curso" },
    ],
  },
  {
    sectionKey: "implementaciones-10",
    rawSectionLabel: "IMPLEMENTACIONES",
    mappedDepartment: "operaciones",
    ownerTeamLabel: "SISTEMAS Y DOCUMENTOS CLAUDE",
    rows: [
      { responsibility: "1 SISTEMA INNOVADOR" },
    ],
  },
  {
    sectionKey: "marketing-11",
    rawSectionLabel: "MARKETING",
    mappedDepartment: "marketing",
    ownerTeamLabel: "PAULINA V.",
    rows: [
      { responsibility: "IMPLEMENTACION DE CANALES DIGITALES", objectiveIndicator: "PLAN CON LUIS , RAQUEL Y MIGUEL" },
      { responsibility: "LOYALTY CARDS", objectiveIndicator: "ANALISIS CLARO CON ESTRATEGIA" },
      { responsibility: "METRICA SEMANAL G,TA,IG, FB, TT, MAILING", objectiveIndicator: "ANALISIS CLARO CON ESTRATEGIA" },
      { responsibility: "GESTION Y RELACION CON PATROCINADORES", objectiveIndicator: "REPORTE CLARO Y PLAN DE TRABAJO" },
      { responsibility: "DIRECCION DDC", objectiveIndicator: "REPORTE Y PLAN MTY Y CDMX" },
      { responsibility: "COLABORACIONES", objectiveIndicator: "REPORTE Y PLAN MTY Y CDMX" },
    ],
  },
  {
    sectionKey: "dise-o-marca-12",
    rawSectionLabel: "DISEÑO/MARCA",
    mappedDepartment: "marketing",
    ownerTeamLabel: "PAULINA V.",
    rows: [
      { responsibility: "EMPAQUES GENERALES", objectiveIndicator: "PLAN CON TIEMPOS PARA ABRIL" },
      { responsibility: "DISEÑO COMUNICACIÓN INTERNA", objectiveIndicator: "PLAN PRIMI, CHUY, RAQUEL Y MIGUEL MAYO 100%" },
      { responsibility: "DISEÑO COMUNICACIÓN EXTERNA", objectiveIndicator: "PLAN CHUY, RAQUEL Y MIGUEL MAYO 100%" },
      { responsibility: "CAMPAÑA 10 AÑOS EN TODO", objectiveIndicator: "PLAN CHUY, RAQUEL Y MIGUEL ABRIL 100%" },
      { responsibility: "CAMIONETA", objectiveIndicator: "EN UNA SEMANA" },
    ],
  },
  {
    sectionKey: "aprendizaje-13",
    rawSectionLabel: "APRENDIZAJE",
    mappedDepartment: "marketing",
    ownerTeamLabel: "LIBROS Y CURSOS Y GENTE",
    rows: [
      { responsibility: "1 LIBRO y 5 REELS ó 1 curso" },
    ],
  },
  {
    sectionKey: "implementaciones-14",
    rawSectionLabel: "IMPLEMENTACIONES",
    mappedDepartment: "marketing",
    ownerTeamLabel: "SISTEMAS Y DOCUMENTOS CLAUDE",
    rows: [
      { responsibility: "1 SISTEMA INNOVADOR" },
    ],
  },
  {
    sectionKey: "ooh-comunidad-15",
    rawSectionLabel: "OOH / COMUNIDAD",
    mappedDepartment: "proyectos",
    ownerTeamLabel: "SEBASTIAN E.",
    rows: [
      { responsibility: "UBER EATS", quantityQuality: "800,000" },
      { responsibility: "GRAB & GO", objectiveIndicator: "100% CUMBRES Y APTOS, PLAN ABRIL CASAS", compliance: "PROYECTAR VENTAS PARA ABRIL" },
      { responsibility: "EVENTOS", quantityQuality: "280,000", compliance: "PLAN LIDER PAL NORTE" },
      { responsibility: "REMODELACIONES", objectiveIndicator: "PLAN CORDI E INNOVA, ABRIL PLAN TAMPI, MAYO, PADRE MIER" },
      { responsibility: "NUEVOS PROYECTOS" },
    ],
  },
  {
    sectionKey: "community-squad-16",
    rawSectionLabel: "COMMUNITY SQUAD",
    mappedDepartment: "proyectos",
    ownerTeamLabel: "SEBASTIAN E.",
    rows: [
      { responsibility: "IMPLEMENTACION", objectiveIndicator: "MARZO 100%" },
    ],
  },
  {
    sectionKey: "champions-19",
    rawSectionLabel: "CHAMPIONS",
    mappedDepartment: "proyectos",
    ownerTeamLabel: "SEBASTIAN E.",
    rows: [
      { responsibility: "COCINA" },
      { responsibility: "BARRA" },
      { responsibility: "PANADERIA" },
      { responsibility: "SERVICIO" },
    ],
  },
];
