export type PayoutMantenimientoRequest = {comision?: string | undefined, concepto?: string | undefined, descuentoM?: string | undefined, descuentoP?: string | undefined, externalMonths?: string | undefined, fecha?: string | undefined, id_usuario?: number | undefined, idreserva?: number | undefined, internalMonths?: string | undefined, lote?: string | undefined, memo?: string | undefined, meses?: string | undefined, monto?: number | undefined, monto_amenidad?: string | undefined, monto_deposito?: string | undefined, orden?: string | undefined, promocion?: string | undefined, tipo?: string | undefined, tipo_pago?: string | undefined}; export type CreateApiApiNewCargoArgs = {body: PayoutMantenimientoRequest}; export type CreateApiApiNewCargoOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Realiza los cargos a la tarjeta * * POST /api/newCargo */ export const createApiApiNewCargo = async (args: CreateApiApiNewCargoArgs, options: CreateApiApiNewCargoOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/newCargo${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };