export type GetApiReportsPettyCashesDriverEpfArgs = {counter_id: number, report_type: 'day_by_day' | 'summary', start_departure_date: string, end_departure_date: string, include_all_drivers?: (0 | 1) | undefined}; export type GetApiReportsPettyCashesDriverEpfOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * View Driver EPF Report * * GET /reports/petty_cashes/driver_epf */ export const getApiReportsPettyCashesDriverEpf = async (args: GetApiReportsPettyCashesDriverEpfArgs, options?: GetApiReportsPettyCashesDriverEpfOptions) => { const {baseUrl = "http://api.gostarmartbus.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.counter_id != null) query.append("counter_id", String(args.counter_id)) if (args.report_type != null) query.append("report_type", String(args.report_type)) if (args.start_departure_date != null) query.append("start_departure_date", String(args.start_departure_date)) if (args.end_departure_date != null) query.append("end_departure_date", String(args.end_departure_date)) if (args.include_all_drivers != null) query.append("include_all_drivers", String(args.include_all_drivers)) const url = `${baseUrl.replace(/\/+$/, '')}/reports/petty_cashes/driver_epf${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };