import { LicitationCategory, LicitationProcedureType, LicitationSource } from "@prisma/client";

export function getProcedureTypeLabel(value: LicitationProcedureType) {
  if (value === LicitationProcedureType.LICITACION_PUBLICA) {
    return "Licitacion publica";
  }

  if (value === LicitationProcedureType.INVITACION_RESTRINGIDA) {
    return "Invitacion restringida";
  }

  if (value === LicitationProcedureType.ADJUDICACION_DIRECTA) {
    return "Adjudicacion directa";
  }

  return "Sin clasificar";
}

export function getCategoryLabel(value: LicitationCategory | null) {
  if (value === LicitationCategory.GOODS) {
    return "Bienes";
  }

  if (value === LicitationCategory.SERVICES) {
    return "Servicios";
  }

  if (value === LicitationCategory.WORKS) {
    return "Obra";
  }

  if (value === LicitationCategory.MIXED) {
    return "Mixto";
  }

  return "Sin categoria";
}

export function getSourceLabel(source: LicitationSource) {
  if (source === LicitationSource.MUNICIPAL_OPEN_PORTAL) {
    return "Portal municipal (oportunidades abiertas)";
  }

  if (source === LicitationSource.PNT) {
    return "Plataforma Nacional de Transparencia";
  }

  if (source === LicitationSource.LICITAYA) {
    return "LicitaYa API";
  }

  return "Portal municipal (respaldo)";
}
