/* tslint:disable */ /* eslint-disable */ /** * loans/transactions * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded, } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap, } from '../base'; // @ts-ignore import type { CreditBalanceDepositTransactionInput } from '../models'; // @ts-ignore import type { DisbursementLoanTransactionInput } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; // @ts-ignore import type { FeeLoanTransactionInput } from '../models'; // @ts-ignore import type { LoanTransaction } from '../models'; // @ts-ignore import type { LoanTransactionAdjustmentDetails } from '../models'; // @ts-ignore import type { LoanTransactionSearchCriteria } from '../models'; // @ts-ignore import type { LockLoanAccountInput } from '../models'; // @ts-ignore import type { LockLoanTransactionsWrapper } from '../models'; // @ts-ignore import type { PaymentMadeTransactionInput } from '../models'; // @ts-ignore import type { PrincipalOverpaymentLoanTransactionInput } from '../models'; // @ts-ignore import type { RedrawRepaymentTransactionInputDTO } from '../models'; // @ts-ignore import type { RefundLoanTransactionInput } from '../models'; // @ts-ignore import type { RepaymentLoanTransactionInput } from '../models'; // @ts-ignore import type { UnlockLoanAccountInput } from '../models'; // @ts-ignore import type { WithdrawalRedrawTransactionInput } from '../models'; /** * LoanTransactionsApi - axios parameter creator */ export const LoanTransactionsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Adjust loan transaction * @param {string} loanTransactionId The ID or encoded key of the loan transaction to be returned. * @param {LoanTransactionAdjustmentDetails} loanTransactionAdjustmentDetails Details of the adjustment. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ adjust: async ( loanTransactionId: string, loanTransactionAdjustmentDetails: LoanTransactionAdjustmentDetails, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanTransactionId' is not null or undefined assertParamExists('adjust', 'loanTransactionId', loanTransactionId); // verify required parameter 'loanTransactionAdjustmentDetails' is not null or undefined assertParamExists( 'adjust', 'loanTransactionAdjustmentDetails', loanTransactionAdjustmentDetails, ); const localVarPath = `/loans/transactions/{loanTransactionId}:adjust`.replace( `{${'loanTransactionId'}}`, encodeURIComponent(String(loanTransactionId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( loanTransactionAdjustmentDetails, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Apply a fee on a loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {FeeLoanTransactionInput} feeLoanTransactionInput Represents the information for creating a transaction of type `FEE_APPLIED` on a loan. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyFee: async ( loanAccountId: string, feeLoanTransactionInput: FeeLoanTransactionInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('applyFee', 'loanAccountId', loanAccountId); // verify required parameter 'feeLoanTransactionInput' is not null or undefined assertParamExists( 'applyFee', 'feeLoanTransactionInput', feeLoanTransactionInput, ); const localVarPath = `/loans/{loanAccountId}/fee-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( feeLoanTransactionInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Lock loan account income sources (interest, fees, penalties) * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {LockLoanAccountInput} lockLoanAccountInput Represents the information for locking an account. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyLock: async ( loanAccountId: string, lockLoanAccountInput: LockLoanAccountInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('applyLock', 'loanAccountId', loanAccountId); // verify required parameter 'lockLoanAccountInput' is not null or undefined assertParamExists( 'applyLock', 'lockLoanAccountInput', lockLoanAccountInput, ); const localVarPath = `/loans/{loanAccountId}/lock-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( lockLoanAccountInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Make payment in redraw balance for loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PaymentMadeTransactionInput} paymentMadeTransactionInput Represents the information for creating a transaction of the type `PAYMENT_MADE`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyPaymentMade: async ( loanAccountId: string, paymentMadeTransactionInput: PaymentMadeTransactionInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('applyPaymentMade', 'loanAccountId', loanAccountId); // verify required parameter 'paymentMadeTransactionInput' is not null or undefined assertParamExists( 'applyPaymentMade', 'paymentMadeTransactionInput', paymentMadeTransactionInput, ); const localVarPath = `/loans/{loanAccountId}/payment-made-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( paymentMadeTransactionInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Unlock loan account income sources (interest, fees, penalties) * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {UnlockLoanAccountInput} unlockLoanAccountInput Represents the information for unlocking an account. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyUnlock: async ( loanAccountId: string, unlockLoanAccountInput: UnlockLoanAccountInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('applyUnlock', 'loanAccountId', loanAccountId); // verify required parameter 'unlockLoanAccountInput' is not null or undefined assertParamExists( 'applyUnlock', 'unlockLoanAccountInput', unlockLoanAccountInput, ); const localVarPath = `/loans/{loanAccountId}/unlock-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( unlockLoanAccountInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get loan transactions * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetAllPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {GetAllDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll: async ( loanAccountId: string, offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('getAll', 'loanAccountId', loanAccountId); const localVarPath = `/loans/{loanAccountId}/transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (paginationDetails !== undefined) { localVarQueryParameter['paginationDetails'] = paginationDetails; } if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get loan transaction * @param {string} loanTransactionId The ID or encoded key of the loan transaction to be returned. * @param {GetByIdDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getById: async ( loanTransactionId: string, detailsLevel?: GetByIdDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanTransactionId' is not null or undefined assertParamExists('getById', 'loanTransactionId', loanTransactionId); const localVarPath = `/loans/transactions/{loanTransactionId}`.replace( `{${'loanTransactionId'}}`, encodeURIComponent(String(loanTransactionId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get loan transactions for all loan account versions * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetTransactionsForAllVersionsPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {GetTransactionsForAllVersionsDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTransactionsForAllVersions: async ( loanAccountId: string, offset?: number, limit?: number, paginationDetails?: GetTransactionsForAllVersionsPaginationDetailsEnum, detailsLevel?: GetTransactionsForAllVersionsDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists( 'getTransactionsForAllVersions', 'loanAccountId', loanAccountId, ); const localVarPath = `/loans/{loanAccountId}/transactions:versions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (paginationDetails !== undefined) { localVarQueryParameter['paginationDetails'] = paginationDetails; } if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Represents the information for creating a transaction of type `CREDIT_BALANCE_DEPOSIT`. * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {CreditBalanceDepositTransactionInput} creditBalanceDepositTransactionInput Represents the information for creating a transaction of type `CREDIT_BALANCE_DEPOSIT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeDepositOnCreditBalance: async ( loanAccountId: string, creditBalanceDepositTransactionInput: CreditBalanceDepositTransactionInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists( 'makeDepositOnCreditBalance', 'loanAccountId', loanAccountId, ); // verify required parameter 'creditBalanceDepositTransactionInput' is not null or undefined assertParamExists( 'makeDepositOnCreditBalance', 'creditBalanceDepositTransactionInput', creditBalanceDepositTransactionInput, ); const localVarPath = `/loans/{loanAccountId}/creditbalance-deposit-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( creditBalanceDepositTransactionInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Make a disbursement on a loan * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {DisbursementLoanTransactionInput} disbursementLoanTransactionInput Input details for the disbursement transaction. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeDisbursement: async ( loanAccountId: string, disbursementLoanTransactionInput: DisbursementLoanTransactionInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('makeDisbursement', 'loanAccountId', loanAccountId); // verify required parameter 'disbursementLoanTransactionInput' is not null or undefined assertParamExists( 'makeDisbursement', 'disbursementLoanTransactionInput', disbursementLoanTransactionInput, ); const localVarPath = `/loans/{loanAccountId}/disbursement-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( disbursementLoanTransactionInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Make non-scheduled principal overpayment transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PrincipalOverpaymentLoanTransactionInput} principalOverpaymentLoanTransactionInput Represents the information for creating a transaction of type `PRINCIPAL_OVERPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makePrincipalOverpayment: async ( loanAccountId: string, principalOverpaymentLoanTransactionInput: PrincipalOverpaymentLoanTransactionInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists( 'makePrincipalOverpayment', 'loanAccountId', loanAccountId, ); // verify required parameter 'principalOverpaymentLoanTransactionInput' is not null or undefined assertParamExists( 'makePrincipalOverpayment', 'principalOverpaymentLoanTransactionInput', principalOverpaymentLoanTransactionInput, ); const localVarPath = `/loans/{loanAccountId}/principal-overpayment-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( principalOverpaymentLoanTransactionInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Make a redraw repayment transaction on a loan * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RedrawRepaymentTransactionInputDTO} redrawRepaymentTransactionInputDTO Represents the information for creating a transaction of type `REDRAW_REPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeRedrawRepayment: async ( loanAccountId: string, redrawRepaymentTransactionInputDTO: RedrawRepaymentTransactionInputDTO, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('makeRedrawRepayment', 'loanAccountId', loanAccountId); // verify required parameter 'redrawRepaymentTransactionInputDTO' is not null or undefined assertParamExists( 'makeRedrawRepayment', 'redrawRepaymentTransactionInputDTO', redrawRepaymentTransactionInputDTO, ); const localVarPath = `/loans/{loanAccountId}/redraw-repayment-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( redrawRepaymentTransactionInputDTO, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Make refund transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RefundLoanTransactionInput} refundLoanTransactionInput Represents the information for creating a transaction of type `REFUND`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeRefund: async ( loanAccountId: string, refundLoanTransactionInput: RefundLoanTransactionInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('makeRefund', 'loanAccountId', loanAccountId); // verify required parameter 'refundLoanTransactionInput' is not null or undefined assertParamExists( 'makeRefund', 'refundLoanTransactionInput', refundLoanTransactionInput, ); const localVarPath = `/loans/{loanAccountId}/refund-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( refundLoanTransactionInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Make repayment transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RepaymentLoanTransactionInput} repaymentLoanTransactionInput Represents the information for creating a transaction of type `REPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeRepayment: async ( loanAccountId: string, repaymentLoanTransactionInput: RepaymentLoanTransactionInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('makeRepayment', 'loanAccountId', loanAccountId); // verify required parameter 'repaymentLoanTransactionInput' is not null or undefined assertParamExists( 'makeRepayment', 'repaymentLoanTransactionInput', repaymentLoanTransactionInput, ); const localVarPath = `/loans/{loanAccountId}/repayment-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( repaymentLoanTransactionInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Make withdrawal from redraw balance * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {WithdrawalRedrawTransactionInput} withdrawalRedrawTransactionInput Represents the information for creating a transaction of type `WITHDRAWAL_REDRAW`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeWithdrawal: async ( loanAccountId: string, withdrawalRedrawTransactionInput: WithdrawalRedrawTransactionInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('makeWithdrawal', 'loanAccountId', loanAccountId); // verify required parameter 'withdrawalRedrawTransactionInput' is not null or undefined assertParamExists( 'makeWithdrawal', 'withdrawalRedrawTransactionInput', withdrawalRedrawTransactionInput, ); const localVarPath = `/loans/{loanAccountId}/withdrawal-transactions`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( withdrawalRedrawTransactionInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Search loan transactions * @param {LoanTransactionSearchCriteria} loanTransactionSearchCriteria Criteria to be used to search the loan transactions. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ search: async ( loanTransactionSearchCriteria: LoanTransactionSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, detailsLevel?: SearchDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanTransactionSearchCriteria' is not null or undefined assertParamExists( 'search', 'loanTransactionSearchCriteria', loanTransactionSearchCriteria, ); const localVarPath = `/loans/transactions:search`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (paginationDetails !== undefined) { localVarQueryParameter['paginationDetails'] = paginationDetails; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( loanTransactionSearchCriteria, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * LoanTransactionsApi - functional programming interface */ export const LoanTransactionsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = LoanTransactionsApiAxiosParamCreator(configuration); return { /** * * @summary Adjust loan transaction * @param {string} loanTransactionId The ID or encoded key of the loan transaction to be returned. * @param {LoanTransactionAdjustmentDetails} loanTransactionAdjustmentDetails Details of the adjustment. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async adjust( loanTransactionId: string, loanTransactionAdjustmentDetails: LoanTransactionAdjustmentDetails, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.adjust( loanTransactionId, loanTransactionAdjustmentDetails, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.adjust']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Apply a fee on a loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {FeeLoanTransactionInput} feeLoanTransactionInput Represents the information for creating a transaction of type `FEE_APPLIED` on a loan. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async applyFee( loanAccountId: string, feeLoanTransactionInput: FeeLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.applyFee( loanAccountId, feeLoanTransactionInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.applyFee']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Lock loan account income sources (interest, fees, penalties) * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {LockLoanAccountInput} lockLoanAccountInput Represents the information for locking an account. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async applyLock( loanAccountId: string, lockLoanAccountInput: LockLoanAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.applyLock( loanAccountId, lockLoanAccountInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.applyLock']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Make payment in redraw balance for loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PaymentMadeTransactionInput} paymentMadeTransactionInput Represents the information for creating a transaction of the type `PAYMENT_MADE`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async applyPaymentMade( loanAccountId: string, paymentMadeTransactionInput: PaymentMadeTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.applyPaymentMade( loanAccountId, paymentMadeTransactionInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.applyPaymentMade']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Unlock loan account income sources (interest, fees, penalties) * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {UnlockLoanAccountInput} unlockLoanAccountInput Represents the information for unlocking an account. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async applyUnlock( loanAccountId: string, unlockLoanAccountInput: UnlockLoanAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.applyUnlock( loanAccountId, unlockLoanAccountInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.applyUnlock']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get loan transactions * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetAllPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {GetAllDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAll( loanAccountId: string, offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAll( loanAccountId, offset, limit, paginationDetails, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.getAll']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get loan transaction * @param {string} loanTransactionId The ID or encoded key of the loan transaction to be returned. * @param {GetByIdDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getById( loanTransactionId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getById( loanTransactionId, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.getById']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get loan transactions for all loan account versions * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetTransactionsForAllVersionsPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {GetTransactionsForAllVersionsDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getTransactionsForAllVersions( loanAccountId: string, offset?: number, limit?: number, paginationDetails?: GetTransactionsForAllVersionsPaginationDetailsEnum, detailsLevel?: GetTransactionsForAllVersionsDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getTransactionsForAllVersions( loanAccountId, offset, limit, paginationDetails, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap[ 'LoanTransactionsApi.getTransactionsForAllVersions' ]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Represents the information for creating a transaction of type `CREDIT_BALANCE_DEPOSIT`. * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {CreditBalanceDepositTransactionInput} creditBalanceDepositTransactionInput Represents the information for creating a transaction of type `CREDIT_BALANCE_DEPOSIT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async makeDepositOnCreditBalance( loanAccountId: string, creditBalanceDepositTransactionInput: CreditBalanceDepositTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.makeDepositOnCreditBalance( loanAccountId, creditBalanceDepositTransactionInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.makeDepositOnCreditBalance']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Make a disbursement on a loan * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {DisbursementLoanTransactionInput} disbursementLoanTransactionInput Input details for the disbursement transaction. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async makeDisbursement( loanAccountId: string, disbursementLoanTransactionInput: DisbursementLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.makeDisbursement( loanAccountId, disbursementLoanTransactionInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.makeDisbursement']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Make non-scheduled principal overpayment transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PrincipalOverpaymentLoanTransactionInput} principalOverpaymentLoanTransactionInput Represents the information for creating a transaction of type `PRINCIPAL_OVERPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async makePrincipalOverpayment( loanAccountId: string, principalOverpaymentLoanTransactionInput: PrincipalOverpaymentLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.makePrincipalOverpayment( loanAccountId, principalOverpaymentLoanTransactionInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.makePrincipalOverpayment']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Make a redraw repayment transaction on a loan * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RedrawRepaymentTransactionInputDTO} redrawRepaymentTransactionInputDTO Represents the information for creating a transaction of type `REDRAW_REPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async makeRedrawRepayment( loanAccountId: string, redrawRepaymentTransactionInputDTO: RedrawRepaymentTransactionInputDTO, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.makeRedrawRepayment( loanAccountId, redrawRepaymentTransactionInputDTO, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.makeRedrawRepayment']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Make refund transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RefundLoanTransactionInput} refundLoanTransactionInput Represents the information for creating a transaction of type `REFUND`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async makeRefund( loanAccountId: string, refundLoanTransactionInput: RefundLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.makeRefund( loanAccountId, refundLoanTransactionInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.makeRefund']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Make repayment transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RepaymentLoanTransactionInput} repaymentLoanTransactionInput Represents the information for creating a transaction of type `REPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async makeRepayment( loanAccountId: string, repaymentLoanTransactionInput: RepaymentLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.makeRepayment( loanAccountId, repaymentLoanTransactionInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.makeRepayment']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Make withdrawal from redraw balance * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {WithdrawalRedrawTransactionInput} withdrawalRedrawTransactionInput Represents the information for creating a transaction of type `WITHDRAWAL_REDRAW`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async makeWithdrawal( loanAccountId: string, withdrawalRedrawTransactionInput: WithdrawalRedrawTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.makeWithdrawal( loanAccountId, withdrawalRedrawTransactionInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.makeWithdrawal']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Search loan transactions * @param {LoanTransactionSearchCriteria} loanTransactionSearchCriteria Criteria to be used to search the loan transactions. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async search( loanTransactionSearchCriteria: LoanTransactionSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.search( loanTransactionSearchCriteria, offset, limit, paginationDetails, cursor, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanTransactionsApi.search']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * LoanTransactionsApi - factory interface */ export const LoanTransactionsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = LoanTransactionsApiFp(configuration); return { /** * * @summary Adjust loan transaction * @param {string} loanTransactionId The ID or encoded key of the loan transaction to be returned. * @param {LoanTransactionAdjustmentDetails} loanTransactionAdjustmentDetails Details of the adjustment. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ adjust( loanTransactionId: string, loanTransactionAdjustmentDetails: LoanTransactionAdjustmentDetails, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .adjust( loanTransactionId, loanTransactionAdjustmentDetails, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Apply a fee on a loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {FeeLoanTransactionInput} feeLoanTransactionInput Represents the information for creating a transaction of type `FEE_APPLIED` on a loan. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyFee( loanAccountId: string, feeLoanTransactionInput: FeeLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .applyFee( loanAccountId, feeLoanTransactionInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Lock loan account income sources (interest, fees, penalties) * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {LockLoanAccountInput} lockLoanAccountInput Represents the information for locking an account. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyLock( loanAccountId: string, lockLoanAccountInput: LockLoanAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .applyLock(loanAccountId, lockLoanAccountInput, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Make payment in redraw balance for loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PaymentMadeTransactionInput} paymentMadeTransactionInput Represents the information for creating a transaction of the type `PAYMENT_MADE`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyPaymentMade( loanAccountId: string, paymentMadeTransactionInput: PaymentMadeTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .applyPaymentMade( loanAccountId, paymentMadeTransactionInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Unlock loan account income sources (interest, fees, penalties) * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {UnlockLoanAccountInput} unlockLoanAccountInput Represents the information for unlocking an account. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyUnlock( loanAccountId: string, unlockLoanAccountInput: UnlockLoanAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .applyUnlock( loanAccountId, unlockLoanAccountInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Get loan transactions * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetAllPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {GetAllDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll( loanAccountId: string, offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAll( loanAccountId, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Get loan transaction * @param {string} loanTransactionId The ID or encoded key of the loan transaction to be returned. * @param {GetByIdDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getById( loanTransactionId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getById(loanTransactionId, detailsLevel, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get loan transactions for all loan account versions * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetTransactionsForAllVersionsPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {GetTransactionsForAllVersionsDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTransactionsForAllVersions( loanAccountId: string, offset?: number, limit?: number, paginationDetails?: GetTransactionsForAllVersionsPaginationDetailsEnum, detailsLevel?: GetTransactionsForAllVersionsDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getTransactionsForAllVersions( loanAccountId, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Represents the information for creating a transaction of type `CREDIT_BALANCE_DEPOSIT`. * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {CreditBalanceDepositTransactionInput} creditBalanceDepositTransactionInput Represents the information for creating a transaction of type `CREDIT_BALANCE_DEPOSIT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeDepositOnCreditBalance( loanAccountId: string, creditBalanceDepositTransactionInput: CreditBalanceDepositTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .makeDepositOnCreditBalance( loanAccountId, creditBalanceDepositTransactionInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Make a disbursement on a loan * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {DisbursementLoanTransactionInput} disbursementLoanTransactionInput Input details for the disbursement transaction. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeDisbursement( loanAccountId: string, disbursementLoanTransactionInput: DisbursementLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .makeDisbursement( loanAccountId, disbursementLoanTransactionInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Make non-scheduled principal overpayment transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PrincipalOverpaymentLoanTransactionInput} principalOverpaymentLoanTransactionInput Represents the information for creating a transaction of type `PRINCIPAL_OVERPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makePrincipalOverpayment( loanAccountId: string, principalOverpaymentLoanTransactionInput: PrincipalOverpaymentLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .makePrincipalOverpayment( loanAccountId, principalOverpaymentLoanTransactionInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Make a redraw repayment transaction on a loan * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RedrawRepaymentTransactionInputDTO} redrawRepaymentTransactionInputDTO Represents the information for creating a transaction of type `REDRAW_REPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeRedrawRepayment( loanAccountId: string, redrawRepaymentTransactionInputDTO: RedrawRepaymentTransactionInputDTO, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .makeRedrawRepayment( loanAccountId, redrawRepaymentTransactionInputDTO, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Make refund transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RefundLoanTransactionInput} refundLoanTransactionInput Represents the information for creating a transaction of type `REFUND`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeRefund( loanAccountId: string, refundLoanTransactionInput: RefundLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .makeRefund( loanAccountId, refundLoanTransactionInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Make repayment transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RepaymentLoanTransactionInput} repaymentLoanTransactionInput Represents the information for creating a transaction of type `REPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeRepayment( loanAccountId: string, repaymentLoanTransactionInput: RepaymentLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .makeRepayment( loanAccountId, repaymentLoanTransactionInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Make withdrawal from redraw balance * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {WithdrawalRedrawTransactionInput} withdrawalRedrawTransactionInput Represents the information for creating a transaction of type `WITHDRAWAL_REDRAW`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ makeWithdrawal( loanAccountId: string, withdrawalRedrawTransactionInput: WithdrawalRedrawTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .makeWithdrawal( loanAccountId, withdrawalRedrawTransactionInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Search loan transactions * @param {LoanTransactionSearchCriteria} loanTransactionSearchCriteria Criteria to be used to search the loan transactions. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ search( loanTransactionSearchCriteria: LoanTransactionSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .search( loanTransactionSearchCriteria, offset, limit, paginationDetails, cursor, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, }; }; /** * LoanTransactionsApi - object-oriented interface */ export class LoanTransactionsApi extends BaseAPI { /** * * @summary Adjust loan transaction * @param {string} loanTransactionId The ID or encoded key of the loan transaction to be returned. * @param {LoanTransactionAdjustmentDetails} loanTransactionAdjustmentDetails Details of the adjustment. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public adjust( loanTransactionId: string, loanTransactionAdjustmentDetails: LoanTransactionAdjustmentDetails, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .adjust( loanTransactionId, loanTransactionAdjustmentDetails, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Apply a fee on a loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {FeeLoanTransactionInput} feeLoanTransactionInput Represents the information for creating a transaction of type `FEE_APPLIED` on a loan. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public applyFee( loanAccountId: string, feeLoanTransactionInput: FeeLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .applyFee(loanAccountId, feeLoanTransactionInput, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Lock loan account income sources (interest, fees, penalties) * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {LockLoanAccountInput} lockLoanAccountInput Represents the information for locking an account. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public applyLock( loanAccountId: string, lockLoanAccountInput: LockLoanAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .applyLock(loanAccountId, lockLoanAccountInput, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Make payment in redraw balance for loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PaymentMadeTransactionInput} paymentMadeTransactionInput Represents the information for creating a transaction of the type `PAYMENT_MADE`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public applyPaymentMade( loanAccountId: string, paymentMadeTransactionInput: PaymentMadeTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .applyPaymentMade( loanAccountId, paymentMadeTransactionInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Unlock loan account income sources (interest, fees, penalties) * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {UnlockLoanAccountInput} unlockLoanAccountInput Represents the information for unlocking an account. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public applyUnlock( loanAccountId: string, unlockLoanAccountInput: UnlockLoanAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .applyUnlock( loanAccountId, unlockLoanAccountInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get loan transactions * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetAllPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {GetAllDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAll( loanAccountId: string, offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .getAll( loanAccountId, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get loan transaction * @param {string} loanTransactionId The ID or encoded key of the loan transaction to be returned. * @param {GetByIdDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getById( loanTransactionId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .getById(loanTransactionId, detailsLevel, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get loan transactions for all loan account versions * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {GetTransactionsForAllVersionsPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {GetTransactionsForAllVersionsDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getTransactionsForAllVersions( loanAccountId: string, offset?: number, limit?: number, paginationDetails?: GetTransactionsForAllVersionsPaginationDetailsEnum, detailsLevel?: GetTransactionsForAllVersionsDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .getTransactionsForAllVersions( loanAccountId, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Represents the information for creating a transaction of type `CREDIT_BALANCE_DEPOSIT`. * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {CreditBalanceDepositTransactionInput} creditBalanceDepositTransactionInput Represents the information for creating a transaction of type `CREDIT_BALANCE_DEPOSIT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public makeDepositOnCreditBalance( loanAccountId: string, creditBalanceDepositTransactionInput: CreditBalanceDepositTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .makeDepositOnCreditBalance( loanAccountId, creditBalanceDepositTransactionInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Make a disbursement on a loan * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {DisbursementLoanTransactionInput} disbursementLoanTransactionInput Input details for the disbursement transaction. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public makeDisbursement( loanAccountId: string, disbursementLoanTransactionInput: DisbursementLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .makeDisbursement( loanAccountId, disbursementLoanTransactionInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Make non-scheduled principal overpayment transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PrincipalOverpaymentLoanTransactionInput} principalOverpaymentLoanTransactionInput Represents the information for creating a transaction of type `PRINCIPAL_OVERPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public makePrincipalOverpayment( loanAccountId: string, principalOverpaymentLoanTransactionInput: PrincipalOverpaymentLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .makePrincipalOverpayment( loanAccountId, principalOverpaymentLoanTransactionInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Make a redraw repayment transaction on a loan * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RedrawRepaymentTransactionInputDTO} redrawRepaymentTransactionInputDTO Represents the information for creating a transaction of type `REDRAW_REPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public makeRedrawRepayment( loanAccountId: string, redrawRepaymentTransactionInputDTO: RedrawRepaymentTransactionInputDTO, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .makeRedrawRepayment( loanAccountId, redrawRepaymentTransactionInputDTO, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Make refund transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RefundLoanTransactionInput} refundLoanTransactionInput Represents the information for creating a transaction of type `REFUND`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public makeRefund( loanAccountId: string, refundLoanTransactionInput: RefundLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .makeRefund( loanAccountId, refundLoanTransactionInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Make repayment transaction on loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {RepaymentLoanTransactionInput} repaymentLoanTransactionInput Represents the information for creating a transaction of type `REPAYMENT`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public makeRepayment( loanAccountId: string, repaymentLoanTransactionInput: RepaymentLoanTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .makeRepayment( loanAccountId, repaymentLoanTransactionInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Make withdrawal from redraw balance * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {WithdrawalRedrawTransactionInput} withdrawalRedrawTransactionInput Represents the information for creating a transaction of type `WITHDRAWAL_REDRAW`. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public makeWithdrawal( loanAccountId: string, withdrawalRedrawTransactionInput: WithdrawalRedrawTransactionInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .makeWithdrawal( loanAccountId, withdrawalRedrawTransactionInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Search loan transactions * @param {LoanTransactionSearchCriteria} loanTransactionSearchCriteria Criteria to be used to search the loan transactions. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public search( loanTransactionSearchCriteria: LoanTransactionSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return LoanTransactionsApiFp(this.configuration) .search( loanTransactionSearchCriteria, offset, limit, paginationDetails, cursor, detailsLevel, options, ) .then((request) => request(this.axios, this.basePath)); } } export const GetAllPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type GetAllPaginationDetailsEnum = (typeof GetAllPaginationDetailsEnum)[keyof typeof GetAllPaginationDetailsEnum]; export const GetAllDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetAllDetailsLevelEnum = (typeof GetAllDetailsLevelEnum)[keyof typeof GetAllDetailsLevelEnum]; export const GetByIdDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetByIdDetailsLevelEnum = (typeof GetByIdDetailsLevelEnum)[keyof typeof GetByIdDetailsLevelEnum]; export const GetTransactionsForAllVersionsPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type GetTransactionsForAllVersionsPaginationDetailsEnum = (typeof GetTransactionsForAllVersionsPaginationDetailsEnum)[keyof typeof GetTransactionsForAllVersionsPaginationDetailsEnum]; export const GetTransactionsForAllVersionsDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetTransactionsForAllVersionsDetailsLevelEnum = (typeof GetTransactionsForAllVersionsDetailsLevelEnum)[keyof typeof GetTransactionsForAllVersionsDetailsLevelEnum]; export const SearchPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type SearchPaginationDetailsEnum = (typeof SearchPaginationDetailsEnum)[keyof typeof SearchPaginationDetailsEnum]; export const SearchDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type SearchDetailsLevelEnum = (typeof SearchDetailsLevelEnum)[keyof typeof SearchDetailsLevelEnum];