interface Servicio {
  id: number;
  nombre: string;
  porcentaje: number;
  color: string | null;
}

interface GastoEntry {
  id: number;
  servicioId: number;
  periodo: string;
  montoFacturado: number;
  montoPagado: number;
  fechaPago: string | null;
  fechaCompletado: string | null;
  notas: string | null;
}

interface PagoServicio {
  id: number;
  fecha: string;
  monto: number;
  notas: string | null;
  creadoPor: string | null;
}

type PagoSortField = "fecha" | "monto" | "notas" | "creadoPor";
type DistribucionSortField = "servicio" | "corresponde" | "pagado" | "deuda";
type EntrySortField = "periodo" | "facturado" | "corresponde" | "pagado" | "diasMora" | "penalidad" | "porcentajeCubierto" | "completado" | "fechaPago" | "notas";

interface PagoServicioRow extends PagoServicio {
  displayNotas: string;
  displayCreadoPor: string;
  proofUrls: string[];
}

const PAGOS_TAB_ID = "__pagos_servicios__";

export type {
  Servicio,
  GastoEntry,
  PagoServicio,
  PagoServicioRow,
  PagoSortField,
  DistribucionSortField,
  EntrySortField,
};

export { PAGOS_TAB_ID };
