export type CreateApiApiFurusatoLimitArgs = {body: {annual_income_jpy: number, marital_status?: ('single' | 'married') | undefined, partner_income_jpy?: number | undefined, dependents_adult?: number | undefined, dependents_elderly?: number | undefined, dependents_university?: number | undefined, dependents_minor?: number | undefined, social_insurance_jpy?: number | undefined, other_deductions_jpy?: number | undefined, income_type?: ('salary' | 'self_employed') | undefined}}; export type CreateApiApiFurusatoLimitOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * 控除上限額シミュレーション (POST — JSON body) * * POST /api/furusato/limit */ export const createApiApiFurusatoLimit = async (args: CreateApiApiFurusatoLimitArgs, options?: CreateApiApiFurusatoLimitOptions) => { const {baseUrl = "https://localgov.jp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/furusato/limit${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 };