fineract_sdk
Version:
Wrapper around fineract api.
816 lines (698 loc) • 77.8 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Apache Fineract
* Apache Fineract is a secure, multi-tenanted microfinance platform The goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform<br>The [reference app](https://cui.fineract.dev) (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation - The API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) - Find out more about Apache Fineract [here](/fineract-provider/api-docs/apiLive.htm#top) - You can [Try The API From Your Browser](/fineract-provider/api-docs/apiLive.htm#interact) - The Generic Options are available [here](/fineract-provider/api-docs/apiLive.htm#genopts) - Find out more about [Updating Dates and Numbers](/fineract-provider/api-docs/apiLive.htm#dates_and_numbers) - For the Authentication and the Basic of HTTP and HTTPS refer [here](/fineract-provider/api-docs/apiLive.htm#authentication_overview) - Check about ERROR codes [here](/fineract-provider/api-docs/apiLive.htm#errors) Please refer to the [old documentation](/fineract-provider/api-docs/apiLive.htm) for any documentation queries
*
* The version of the OpenAPI document: 1.5.0-66-gffae7d4-dirty
* Contact: dev@fineract.apache.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import { DeleteClientsClientIdResponse } from '../models';
// @ts-ignore
import { FormDataContentDisposition } from '../models';
// @ts-ignore
import { GetClientsClientIdAccountsResponse } from '../models';
// @ts-ignore
import { GetClientsClientIdResponse } from '../models';
// @ts-ignore
import { GetClientsResponse } from '../models';
// @ts-ignore
import { GetClientsTemplateResponse } from '../models';
// @ts-ignore
import { PostClientsClientIdRequest } from '../models';
// @ts-ignore
import { PostClientsClientIdResponse } from '../models';
// @ts-ignore
import { PostClientsRequest } from '../models';
// @ts-ignore
import { PostClientsResponse } from '../models';
// @ts-ignore
import { PutClientsClientIdRequest } from '../models';
// @ts-ignore
import { PutClientsClientIdResponse } from '../models';
/**
* ClientApi - axios parameter creator
* @export
*/
export const ClientApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Note: 1. You can enter either:firstname/middlename/lastname - for a person (middlename is optional) OR fullname - for a business or organisation (or person known by one name). 2.If address is enable(enable-address=true), then additional field called address has to be passed. Mandatory Fields: firstname and lastname OR fullname, officeId, active=true and activationDate OR active=false, if(address enabled) address Optional Fields: groupId, externalId, accountNo, staffId, mobileNo, savingsProductId, genderId, clientTypeId, clientClassificationId
* @summary Create a Client
* @param {PostClientsRequest} postClientsRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createClient: async (postClientsRequest: PostClientsRequest, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'postClientsRequest' is not null or undefined
assertParamExists('createClient', 'postClientsRequest', postClientsRequest)
const localVarPath = `/clients`;
// 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 basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(postClientsRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* If a client is in Pending state, you are allowed to Delete it. The delete is a \'hard delete\' and cannot be recovered from. Once clients become active or have loans or savings associated with them, you cannot delete the client but you may Close the client if they have left the program.
* @summary Delete a Client
* @param {number} clientId clientId
* @param {object} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteClient: async (clientId: number, body: object, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'clientId' is not null or undefined
assertParamExists('deleteClient', 'clientId', clientId)
// verify required parameter 'body' is not null or undefined
assertParamExists('deleteClient', 'body', body)
const localVarPath = `/clients/{clientId}`
.replace(`{${"clientId"}}`, encodeURIComponent(String(clientId)));
// 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: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} [legalFormType]
* @param {number} [officeId]
* @param {number} [staffId]
* @param {string} [dateFormat]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getClientTemplate: async (legalFormType?: string, officeId?: number, staffId?: number, dateFormat?: string, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/clients/downloadtemplate`;
// 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 basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
if (legalFormType !== undefined) {
localVarQueryParameter['legalFormType'] = legalFormType;
}
if (officeId !== undefined) {
localVarQueryParameter['officeId'] = officeId;
}
if (staffId !== undefined) {
localVarQueryParameter['staffId'] = staffId;
}
if (dateFormat !== undefined) {
localVarQueryParameter['dateFormat'] = dateFormat;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Activate a Client: Clients can be created in a Pending state. This API exists to enable client activation (for when a client becomes an approved member of the financial Institution). If the client happens to be already active this API will result in an error. Close a Client: Clients can be closed if they do not have any non-closed loans/savingsAccount. This API exists to close a client . If the client have any active loans/savingsAccount this API will result in an error. Reject a Client: Clients can be rejected when client is in pending for activation status. If the client is any other status, this API throws an error. Mandatory Fields: rejectionDate, rejectionReasonId Withdraw a Client: Client applications can be withdrawn when client is in a pending for activation status. If the client is any other status, this API throws an error. Mandatory Fields: withdrawalDate, withdrawalReasonId Reactivate a Client: Clients can be reactivated after they have been closed. Trying to reactivate a client in any other state throws an error. Mandatory Fields: reactivationDate UndoReject a Client: Clients can be reactivated after they have been rejected. Trying to reactivate a client in any other state throws an error. Mandatory Fields: reopenedDateUndoWithdraw a Client: Clients can be reactivated after they have been withdrawn. Trying to reactivate a client in any other state throws an error. Mandatory Fields: reopenedDate Assign a Staff: Allows you to assign a Staff for existed Client. The selected Staff should belong to the same office (or an officer higher up in the hierarchy) as the Client he manages. Unassign a Staff: Allows you to unassign the Staff assigned to a Client. Update Default Savings Account: Allows you to modify or assign a default savings account for an existing Client. The selected savings account should be one among the existing savings account for a particular customer. Propose a Client Transfer: Allows you to propose the transfer of a Client to a different Office. Withdraw a Client Transfer: Allows you to withdraw the proposed transfer of a Client to a different Office. Withdrawal can happen only if the destination Branch (to which the transfer was proposed) has not already accepted the transfer proposal Reject a Client Transfer: Allows the Destination Branch to reject the proposed Client Transfer. Accept a Client Transfer: Allows the Destination Branch to accept the proposed Client Transfer. The destination branch may also choose to link this client to a group (in which case, any existing active JLG loan of the client is rescheduled to match the meeting frequency of the group) and loan Officer at the time of accepting the transfer Propose and Accept a Client Transfer: Abstraction over the Propose and Accept Client Transfer API\'s which enable a user with Data Scope over both the Target and Destination Branches to directly transfer a Client to the destination Office. Showing request/response for \'Reject a Client Transfer\'
* @summary Activate a Client | Close a Client | Reject a Client | Withdraw a Client | Reactivate a Client | UndoReject a Client | UndoWithdraw a Client | Assign a Staff | Unassign a Staff | Update Default Savings Account | Propose a Client Transfer | Withdraw a Client Transfer | Reject a Client Transfer | Accept a Client Transfer | Propose and Accept a Client Transfer
* @param {number} clientId clientId
* @param {PostClientsClientIdRequest} postClientsClientIdRequest
* @param {string} [command] command
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
manageClient: async (clientId: number, postClientsClientIdRequest: PostClientsClientIdRequest, command?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'clientId' is not null or undefined
assertParamExists('manageClient', 'clientId', clientId)
// verify required parameter 'postClientsClientIdRequest' is not null or undefined
assertParamExists('manageClient', 'postClientsClientIdRequest', postClientsClientIdRequest)
const localVarPath = `/clients/{clientId}`
.replace(`{${"clientId"}}`, encodeURIComponent(String(clientId)));
// 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 basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
if (command !== undefined) {
localVarQueryParameter['command'] = command;
}
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(postClientsClientIdRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {string} [legalFormType]
* @param {FormDataContentDisposition} [file]
* @param {string} [locale]
* @param {string} [dateFormat]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
postClientTemplate: async (legalFormType?: string, file?: FormDataContentDisposition, locale?: string, dateFormat?: string, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/clients/uploadtemplate`;
// 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;
const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
if (legalFormType !== undefined) {
localVarQueryParameter['legalFormType'] = legalFormType;
}
if (file !== undefined) {
localVarFormParams.append('file', new Blob([JSON.stringify(file)], { type: "application/json", }));
}
if (locale !== undefined) {
localVarFormParams.append('locale', locale as any);
}
if (dateFormat !== undefined) {
localVarFormParams.append('dateFormat', dateFormat as any);
}
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = localVarFormParams;
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* An example of how a loan portfolio summary can be provided. This is requested in a specific use case of the community application. It is quite reasonable to add resources like this to simplify User Interface development. Example Requests: clients/1/accounts clients/1/accounts?fields=loanAccounts,savingsAccounts
* @summary Retrieve client accounts overview
* @param {number} clientId clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveAssociatedAccounts: async (clientId: number, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'clientId' is not null or undefined
assertParamExists('retrieveAssociatedAccounts', 'clientId', clientId)
const localVarPath = `/clients/{clientId}/accounts`
.replace(`{${"clientId"}}`, encodeURIComponent(String(clientId)));
// 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 basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Example Requests: clients/1 clients/1?template=true clients/1?fields=id,displayName,officeName
* @summary Retrieve a Client
* @param {number} clientId clientId
* @param {boolean} [staffInSelectedOfficeOnly] staffInSelectedOfficeOnly
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveClient: async (clientId: number, staffInSelectedOfficeOnly?: boolean, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'clientId' is not null or undefined
assertParamExists('retrieveClient', 'clientId', clientId)
const localVarPath = `/clients/{clientId}`
.replace(`{${"clientId"}}`, encodeURIComponent(String(clientId)));
// 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 basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
if (staffInSelectedOfficeOnly !== undefined) {
localVarQueryParameter['staffInSelectedOfficeOnly'] = staffInSelectedOfficeOnly;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: Field Defaults Allowed Value Lists Example Request: clients/template
* @summary Retrieve Client Details Template
* @param {number} [officeId] officeId
* @param {string} [commandParam] commandParam
* @param {boolean} [staffInSelectedOfficeOnly] staffInSelectedOfficeOnly
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveClientTemplate: async (officeId?: number, commandParam?: string, staffInSelectedOfficeOnly?: boolean, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/clients/template`;
// 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 basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
if (officeId !== undefined) {
localVarQueryParameter['officeId'] = officeId;
}
if (commandParam !== undefined) {
localVarQueryParameter['commandParam'] = commandParam;
}
if (staffInSelectedOfficeOnly !== undefined) {
localVarQueryParameter['staffInSelectedOfficeOnly'] = staffInSelectedOfficeOnly;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* The list capability of clients can support pagination and sorting. Example Requests: clients clients?fields=displayName,officeName,timeline clients?offset=10&limit=50 clients?orderBy=displayName&sortOrder=DESC
* @summary List Clients
* @param {string} [sqlSearch] sqlSearch
* @param {number} [officeId] officeId
* @param {string} [externalId] externalId
* @param {string} [displayName] displayName
* @param {string} [firstName] firstName
* @param {string} [lastName] lastName
* @param {string} [status] status
* @param {string} [underHierarchy] underHierarchy
* @param {number} [offset] offset
* @param {number} [limit] limit
* @param {string} [orderBy] orderBy
* @param {string} [sortOrder] sortOrder
* @param {boolean} [orphansOnly] orphansOnly
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveClients: async (sqlSearch?: string, officeId?: number, externalId?: string, displayName?: string, firstName?: string, lastName?: string, status?: string, underHierarchy?: string, offset?: number, limit?: number, orderBy?: string, sortOrder?: string, orphansOnly?: boolean, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/clients`;
// 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 basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
if (sqlSearch !== undefined) {
localVarQueryParameter['sqlSearch'] = sqlSearch;
}
if (officeId !== undefined) {
localVarQueryParameter['officeId'] = officeId;
}
if (externalId !== undefined) {
localVarQueryParameter['externalId'] = externalId;
}
if (displayName !== undefined) {
localVarQueryParameter['displayName'] = displayName;
}
if (firstName !== undefined) {
localVarQueryParameter['firstName'] = firstName;
}
if (lastName !== undefined) {
localVarQueryParameter['lastName'] = lastName;
}
if (status !== undefined) {
localVarQueryParameter['status'] = status;
}
if (underHierarchy !== undefined) {
localVarQueryParameter['underHierarchy'] = underHierarchy;
}
if (offset !== undefined) {
localVarQueryParameter['offset'] = offset;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (orderBy !== undefined) {
localVarQueryParameter['orderBy'] = orderBy;
}
if (sortOrder !== undefined) {
localVarQueryParameter['sortOrder'] = sortOrder;
}
if (orphansOnly !== undefined) {
localVarQueryParameter['orphansOnly'] = orphansOnly;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {number} clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveObligeeDetails: async (clientId: number, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'clientId' is not null or undefined
assertParamExists('retrieveObligeeDetails', 'clientId', clientId)
const localVarPath = `/clients/{clientId}/obligeedetails`
.replace(`{${"clientId"}}`, encodeURIComponent(String(clientId)));
// 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 basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {number} clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveTransferTemplate: async (clientId: number, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'clientId' is not null or undefined
assertParamExists('retrieveTransferTemplate', 'clientId', clientId)
const localVarPath = `/clients/{clientId}/transferproposaldate`
.replace(`{${"clientId"}}`, encodeURIComponent(String(clientId)));
// 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 basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Note: You can update any of the basic attributes of a client (but not its associations) using this API. Changing the relationship between a client and its office is not supported through this API. An API specific to handling transfers of clients between offices is available for the same. The relationship between a client and a group must be removed through the Groups API.
* @summary Update a Client
* @param {number} clientId clientId
* @param {PutClientsClientIdRequest} putClientsClientIdRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateClient: async (clientId: number, putClientsClientIdRequest: PutClientsClientIdRequest, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'clientId' is not null or undefined
assertParamExists('updateClient', 'clientId', clientId)
// verify required parameter 'putClientsClientIdRequest' is not null or undefined
assertParamExists('updateClient', 'putClientsClientIdRequest', putClientsClientIdRequest)
const localVarPath = `/clients/{clientId}`
.replace(`{${"clientId"}}`, encodeURIComponent(String(clientId)));
// 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: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(putClientsClientIdRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* ClientApi - functional programming interface
* @export
*/
export const ClientApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ClientApiAxiosParamCreator(configuration)
return {
/**
* Note: 1. You can enter either:firstname/middlename/lastname - for a person (middlename is optional) OR fullname - for a business or organisation (or person known by one name). 2.If address is enable(enable-address=true), then additional field called address has to be passed. Mandatory Fields: firstname and lastname OR fullname, officeId, active=true and activationDate OR active=false, if(address enabled) address Optional Fields: groupId, externalId, accountNo, staffId, mobileNo, savingsProductId, genderId, clientTypeId, clientClassificationId
* @summary Create a Client
* @param {PostClientsRequest} postClientsRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createClient(postClientsRequest: PostClientsRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostClientsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createClient(postClientsRequest, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* If a client is in Pending state, you are allowed to Delete it. The delete is a \'hard delete\' and cannot be recovered from. Once clients become active or have loans or savings associated with them, you cannot delete the client but you may Close the client if they have left the program.
* @summary Delete a Client
* @param {number} clientId clientId
* @param {object} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteClient(clientId: number, body: object, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteClientsClientIdResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteClient(clientId, body, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} [legalFormType]
* @param {number} [officeId]
* @param {number} [staffId]
* @param {string} [dateFormat]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getClientTemplate(legalFormType?: string, officeId?: number, staffId?: number, dateFormat?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getClientTemplate(legalFormType, officeId, staffId, dateFormat, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Activate a Client: Clients can be created in a Pending state. This API exists to enable client activation (for when a client becomes an approved member of the financial Institution). If the client happens to be already active this API will result in an error. Close a Client: Clients can be closed if they do not have any non-closed loans/savingsAccount. This API exists to close a client . If the client have any active loans/savingsAccount this API will result in an error. Reject a Client: Clients can be rejected when client is in pending for activation status. If the client is any other status, this API throws an error. Mandatory Fields: rejectionDate, rejectionReasonId Withdraw a Client: Client applications can be withdrawn when client is in a pending for activation status. If the client is any other status, this API throws an error. Mandatory Fields: withdrawalDate, withdrawalReasonId Reactivate a Client: Clients can be reactivated after they have been closed. Trying to reactivate a client in any other state throws an error. Mandatory Fields: reactivationDate UndoReject a Client: Clients can be reactivated after they have been rejected. Trying to reactivate a client in any other state throws an error. Mandatory Fields: reopenedDateUndoWithdraw a Client: Clients can be reactivated after they have been withdrawn. Trying to reactivate a client in any other state throws an error. Mandatory Fields: reopenedDate Assign a Staff: Allows you to assign a Staff for existed Client. The selected Staff should belong to the same office (or an officer higher up in the hierarchy) as the Client he manages. Unassign a Staff: Allows you to unassign the Staff assigned to a Client. Update Default Savings Account: Allows you to modify or assign a default savings account for an existing Client. The selected savings account should be one among the existing savings account for a particular customer. Propose a Client Transfer: Allows you to propose the transfer of a Client to a different Office. Withdraw a Client Transfer: Allows you to withdraw the proposed transfer of a Client to a different Office. Withdrawal can happen only if the destination Branch (to which the transfer was proposed) has not already accepted the transfer proposal Reject a Client Transfer: Allows the Destination Branch to reject the proposed Client Transfer. Accept a Client Transfer: Allows the Destination Branch to accept the proposed Client Transfer. The destination branch may also choose to link this client to a group (in which case, any existing active JLG loan of the client is rescheduled to match the meeting frequency of the group) and loan Officer at the time of accepting the transfer Propose and Accept a Client Transfer: Abstraction over the Propose and Accept Client Transfer API\'s which enable a user with Data Scope over both the Target and Destination Branches to directly transfer a Client to the destination Office. Showing request/response for \'Reject a Client Transfer\'
* @summary Activate a Client | Close a Client | Reject a Client | Withdraw a Client | Reactivate a Client | UndoReject a Client | UndoWithdraw a Client | Assign a Staff | Unassign a Staff | Update Default Savings Account | Propose a Client Transfer | Withdraw a Client Transfer | Reject a Client Transfer | Accept a Client Transfer | Propose and Accept a Client Transfer
* @param {number} clientId clientId
* @param {PostClientsClientIdRequest} postClientsClientIdRequest
* @param {string} [command] command
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async manageClient(clientId: number, postClientsClientIdRequest: PostClientsClientIdRequest, command?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostClientsClientIdResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.manageClient(clientId, postClientsClientIdRequest, command, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} [legalFormType]
* @param {FormDataContentDisposition} [file]
* @param {string} [locale]
* @param {string} [dateFormat]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async postClientTemplate(legalFormType?: string, file?: FormDataContentDisposition, locale?: string, dateFormat?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.postClientTemplate(legalFormType, file, locale, dateFormat, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* An example of how a loan portfolio summary can be provided. This is requested in a specific use case of the community application. It is quite reasonable to add resources like this to simplify User Interface development. Example Requests: clients/1/accounts clients/1/accounts?fields=loanAccounts,savingsAccounts
* @summary Retrieve client accounts overview
* @param {number} clientId clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async retrieveAssociatedAccounts(clientId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetClientsClientIdAccountsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveAssociatedAccounts(clientId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Example Requests: clients/1 clients/1?template=true clients/1?fields=id,displayName,officeName
* @summary Retrieve a Client
* @param {number} clientId clientId
* @param {boolean} [staffInSelectedOfficeOnly] staffInSelectedOfficeOnly
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async retrieveClient(clientId: number, staffInSelectedOfficeOnly?: boolean, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetClientsClientIdResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveClient(clientId, staffInSelectedOfficeOnly, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: Field Defaults Allowed Value Lists Example Request: clients/template
* @summary Retrieve Client Details Template
* @param {number} [officeId] officeId
* @param {string} [commandParam] commandParam
* @param {boolean} [staffInSelectedOfficeOnly] staffInSelectedOfficeOnly
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async retrieveClientTemplate(officeId?: number, commandParam?: string, staffInSelectedOfficeOnly?: boolean, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetClientsTemplateResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveClientTemplate(officeId, commandParam, staffInSelectedOfficeOnly, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* The list capability of clients can support pagination and sorting. Example Requests: clients clients?fields=displayName,officeName,timeline clients?offset=10&limit=50 clients?orderBy=displayName&sortOrder=DESC
* @summary List Clients
* @param {string} [sqlSearch] sqlSearch
* @param {number} [officeId] officeId
* @param {string} [externalId] externalId
* @param {string} [displayName] displayName
* @param {string} [firstName] firstName
* @param {string} [lastName] lastName
* @param {string} [status] status
* @param {string} [underHierarchy] underHierarchy
* @param {number} [offset] offset
* @param {number} [limit] limit
* @param {string} [orderBy] orderBy
* @param {string} [sortOrder] sortOrder
* @param {boolean} [orphansOnly] orphansOnly
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async retrieveClients(sqlSearch?: string, officeId?: number, externalId?: string, displayName?: string, firstName?: string, lastName?: string, status?: string, underHierarchy?: string, offset?: number, limit?: number, orderBy?: string, sortOrder?: string, orphansOnly?: boolean, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetClientsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveClients(sqlSearch, officeId, externalId, displayName, firstName, lastName, status, underHierarchy, offset, limit, orderBy, sortOrder, orphansOnly, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {number} clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async retrieveObligeeDetails(clientId: number, options?: any): Promi