export type UpdateDispensedItemBillingDto = {markedForBilling?: boolean | undefined}; export type PatchApiAppointmentsIdDispensedItemsTransactionIdBillingArgs = {id: string, transactionId: string, body: UpdateDispensedItemBillingDto}; export type PatchApiAppointmentsIdDispensedItemsTransactionIdBillingOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update the billing status of a dispensed item * * PATCH /Appointments/{id}/dispensed-items/{transactionId}/billing */ export const patchApiAppointmentsIdDispensedItemsTransactionIdBilling = async (args: PatchApiAppointmentsIdDispensedItemsTransactionIdBillingArgs, options?: PatchApiAppointmentsIdDispensedItemsTransactionIdBillingOptions) => { const {baseUrl = "https://api.clinicos.vet/backend/business", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/Appointments/${encodeURIComponent(String(args.id))}/dispensed-items/${encodeURIComponent(String(args.transactionId))}/billing${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 undefined };