import ApiService from "@/services/ApiService";

const baseUrl = "ventas";

export const getVentasMensuales = async (year = null, month = null) => {
  const params = {};
  if (year) params.year = year;
  if (month) params.month = month;
  const response = await ApiService.get(`${baseUrl}/mensual`, { params });
  return response.data;
};

/**
 * Catálogo POS: prioridades, tipos de prenda, tipos de carga (TIBU).
 */
export const getPosCatalog = async () => {
  const response = await ApiService.get("laundry/pos-catalog");
  return response.data;
};

/** Vista previa de totales (mismas reglas que crear orden con ítems). */
export const postPosPreviewTotals = async (payload) => {
  const response = await ApiService.post("laundry/pos/preview-totals", payload);
  return response.data;
};
