import type { Voucher } from '@entities' import type { HttpClient } from '@services' import type { ApiError, Response } from '@types' type AssignVoucher = { voucherId: string params: { voucher: { state: string associated_contracts_attributes: Record< string, { id: string payment_transactions_attributes: Record< string, { amount: string assignation_actor_id: number assigned_at: string contract_id: string currency: string due_on: string fulfilled_at: string id?: string kind: string nth_of_kind: number voucher_id: string } > } > } } } const assignVoucher = (http: HttpClient) => ({ query: ( input: AssignVoucher, ): Promise> => { return http.post( `v3/admin/vouchers/${input.voucherId}/assigns`, input.params, ) }, }) export default assignVoucher