import ApiService from "@/services/ApiService";

/**
 * Reimpresión de ticket de venta en impresora térmica ESC/POS.
 * @param {number} ordenId
 * @param {number|null} [impresoraId]
 * @param {{ posReception?: boolean }} [options]
 */
export const reimprimirTicket = async (ordenId, impresoraId = null, { posReception = false } = {}) => {
  const body = {};
  if (impresoraId != null) body.impresora_id = impresoraId;
  if (posReception) body.pos_reception = true;
  const res = await ApiService.post(`lavanderia/ordenes/${ordenId}/reimprimir-ticket`, body);
  return res.data;
};
