export type CreateApiApiV1PosCashCountActionsAddArgs = {body: {project: {id: string}, cashier: {id: string}, comment: string, difference: number, cashQuantity: {eur500: number, eur200: number, eur100: number, eur50: number, eur20: number, eur10: number, eur5: number, eur2: number, eur1: number, eur05: number, eur02: number, eur01: number, eur005: number, eur002: number, eur001: number} | null}}; export type CreateApiApiV1PosCashCountActionsAddOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add cash count entry * * POST /api/v1/posCashCount/actions/add */ export const createApiApiV1PosCashCountActionsAdd = async (args: CreateApiApiV1PosCashCountActionsAddArgs, options?: CreateApiApiV1PosCashCountActionsAddOptions) => { const {baseUrl = "https://xentral.xentral.biz", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "text/html") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/posCashCount/actions/add${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.text() };