export type PurchaseRateCommand = {comment?: string | undefined, complaints?: (Array<'BAD_SERVICE' | 'BAD_PAYMENT_EXPERIANCE'>) | undefined, complaintsString?: string | undefined, id?: number | undefined, priceRate?: number | undefined, qualityRate?: number | undefined, rate?: number | undefined, referenceNumber?: number | undefined, title?: string | undefined, transactionId?: number | undefined}; export type CreateApiApiCustomerPurchasesRateArgs = {body: PurchaseRateCommand}; export type CreateApiApiCustomerPurchasesRateOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * rate * * POST /api/customer/purchases/rate */ export const createApiApiCustomerPurchasesRate = async (args: CreateApiApiCustomerPurchasesRateArgs, options: CreateApiApiCustomerPurchasesRateOptions) => { 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/customer/purchases/rate${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() };