export type User = {activated: boolean, clubCardNumber?: number | undefined, clubCode?: number | undefined, clubType?: ('AYRIA' | 'PERSEPOLIS' | 'KARAFARIN' | 'BIMEHKHAVARMIYANE') | undefined, email?: string | undefined, firstName?: string | undefined, fullname?: string | undefined, gender?: ('MALE' | 'FEMALE') | undefined, id?: number | undefined, imageUrl?: string | undefined, langKey?: string | undefined, lastName?: string | undefined, locked?: boolean | undefined, login: string, mobile?: string | undefined, nickname?: string | undefined, notSystem?: boolean | undefined, originClubCode?: number | undefined, persepolisi?: boolean | undefined, plan?: ('BASIC' | 'GOLD' | 'STAR' | 'GALAXY') | undefined, system?: boolean | undefined}; export type AcceptorRegisterCommand = {acceptorName?: string | undefined, address?: string | undefined, department: 'SPORT' | 'CLOTHING' | 'CONSULTING' | 'DIGITAL' | 'RESTAURANT' | 'HEALTH' | 'SCIENCE' | 'STORE' | 'TRAVEL' | 'HOME_APPLIANCE' | 'BEAUTY' | 'JEWELLERY' | 'CULTURE' | 'FORMALITY' | 'ART' | 'CAR' | 'BUILDING', discount?: number | undefined, firstName?: string | undefined, kargozar?: User | undefined, lastName?: string | undefined, mobile: string, ostan: number, owner?: boolean | undefined, registrar?: User | undefined, user?: User | undefined}; export type CreateApiApiUserAcceptorRegisterArgs = {body: AcceptorRegisterCommand}; export type CreateApiApiUserAcceptorRegisterOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * register * * POST /api/user/acceptor/register */ export const createApiApiUserAcceptorRegister = async (args: CreateApiApiUserAcceptorRegisterArgs, options: CreateApiApiUserAcceptorRegisterOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/user/acceptor/register${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 undefined };