export type ExperienceBaselineItem = {
  key: string;
  label: string;
  weight?: number;
  allowsComment?: boolean;
  requiresObservation?: boolean;
  allowsEvidence?: boolean;
};

export type ExperienceBaselineCategory = {
  key: string;
  name: string;
  weight?: number;
  items: ExperienceBaselineItem[];
};

export const EXPERIENCE_BASELINE_LOCATIONS: Array<{ code: string; name: string; city: string }> = [
  { code: "mty-tampiquito", name: "Tampiquito", city: "MTY" },
  { code: "mty-cordillera", name: "Cordillera", city: "MTY" },
  { code: "mty-armida", name: "Armida", city: "MTY" },
  { code: "mty-centro", name: "Centro", city: "MTY" },
  { code: "mty-innovasport", name: "Innovasport", city: "MTY" },
  { code: "mty-terminal-a", name: "Terminal A", city: "MTY" },
  { code: "mty-terminal-b", name: "Terminal B", city: "MTY" },
  { code: "mty-park-point", name: "Park point", city: "MTY" },
  { code: "cdmx-roma-norte", name: "Roma norte", city: "CDMX" },
];

export const EXPERIENCE_BASE_TEMPLATE_NAME = "Experienciómetro Base";

export const EXPERIENCE_BASE_TEMPLATE_CATEGORIES: ExperienceBaselineCategory[] = [
  {
    key: "exterior_llegada",
    name: "Exterior y llegada",
    weight: 1,
    items: [
      { key: "limpieza_exterior", label: "Limpieza exterior", weight: 1 },
      { key: "fachada", label: "Fachada en buen estado", weight: 1 },
      { key: "acceso", label: "Acceso libre y cómodo", weight: 1 },
      { key: "senalizacion", label: "Señalización visible", weight: 1 },
    ],
  },
  {
    key: "entrada_bienvenida",
    name: "Entrada y bienvenida",
    weight: 1,
    items: [
      { key: "puerta_abierta", label: "Puerta abierta / acceso disponible", weight: 1 },
      { key: "recepcion", label: "Recepción activa", weight: 1 },
      { key: "saludo", label: "Saludo adecuado", weight: 1 },
      { key: "actitud_bienvenida", label: "Actitud positiva", weight: 1 },
      { key: "tiempo_respuesta", label: "Tiempo de respuesta", weight: 1 },
    ],
  },
  {
    key: "ambiente",
    name: "Ambiente",
    weight: 1,
    items: [
      { key: "orden_visual", label: "Orden visual", weight: 1 },
      { key: "aroma", label: "Aroma agradable", weight: 1 },
      { key: "musica", label: "Música adecuada", weight: 1 },
      { key: "limpieza_general", label: "Limpieza general", weight: 1 },
      { key: "temperatura", label: "Temperatura cómoda", weight: 1 },
      { key: "confort", label: "Mobiliario / confort", weight: 1 },
    ],
  },
  {
    key: "servicio",
    name: "Servicio",
    weight: 1,
    items: [
      { key: "rapidez", label: "Rapidez", weight: 1 },
      { key: "amabilidad", label: "Amabilidad", weight: 1 },
      { key: "seguimiento", label: "Seguimiento", weight: 1 },
      { key: "detalle", label: "Atención al detalle", weight: 1 },
      { key: "actitud_personal", label: "Actitud del personal", weight: 1 },
    ],
  },
  {
    key: "hospitalidad",
    name: "Hospitalidad / detalles extra",
    weight: 1,
    items: [
      { key: "detalles_memorables", label: "Detalles memorables", weight: 1 },
      { key: "anticipacion", label: "Anticipación a necesidades", weight: 1 },
      { key: "extras", label: "Extras que elevan la experiencia", weight: 1 },
    ],
  },
  {
    key: "operacion_visible",
    name: "Operación visible",
    weight: 1,
    items: [
      { key: "banos", label: "Baños limpios", weight: 1 },
      { key: "areas_comunes", label: "Áreas comunes ordenadas", weight: 1 },
      { key: "objetos_fuera_lugar", label: "Objetos fuera de lugar", weight: 1 },
      { key: "mantenimiento", label: "Mantenimiento visible", weight: 1 },
    ],
  },
];

export const EXPERIENCE_DEFAULT_POLICY = {
  name: "Política base Experienciómetro",
  aggregationMode: "weighted_recent" as const,
  recentWindow: 3,
  recentWeights: [0.5, 0.3, 0.2],
  greenThreshold: 85,
  yellowThreshold: 70,
};
