UNPKG

fineract_sdk

Version:

Wrapper around fineract api.

873 lines (745 loc) 77.6 kB
/* 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 { DeleteGroupsGroupIdResponse } from '../models'; // @ts-ignore import { FormDataContentDisposition } from '../models'; // @ts-ignore import { GetGroupsGroupIdAccountsResponse } from '../models'; // @ts-ignore import { GetGroupsGroupIdResponse } from '../models'; // @ts-ignore import { GetGroupsResponse } from '../models'; // @ts-ignore import { GetGroupsTemplateResponse } from '../models'; // @ts-ignore import { PostGroupsGroupIdCommandUnassignStaffRequest } from '../models'; // @ts-ignore import { PostGroupsGroupIdCommandUnassignStaffResponse } from '../models'; // @ts-ignore import { PostGroupsGroupIdRequest } from '../models'; // @ts-ignore import { PostGroupsGroupIdResponse } from '../models'; // @ts-ignore import { PostGroupsRequest } from '../models'; // @ts-ignore import { PostGroupsResponse } from '../models'; // @ts-ignore import { PutGroupsGroupIdRequest } from '../models'; // @ts-ignore import { PutGroupsGroupIdResponse } from '../models'; /** * GroupsApi - axios parameter creator * @export */ export const GroupsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Activate a Group: Groups can be created in a Pending state. This API exists to enable group activation. If the group happens to be already active this API will result in an error. Mandatory Fields: activationDate Associate Clients: This API allows to associate existing clients to a group. The clients are listed from the office to which the group is associated. If client(s) is already associated with group then API will result in an error. Mandatory Fields: clientMembers Disassociate Clients: This API allows to disassociate clients from a group. Disassociating a client with active joint liability group loans results in an error. Mandatory Fields: clientMembers Transfer Clients across groups: This API allows to transfer clients from one group to another Mandatory Fields: destinationGroupId and clients Optional Fields: inheritDestinationGroupLoanOfficer (defaults to true) and transferActiveLoans (defaults to true) Generate Collection Sheet: This API retrieves repayment details of all jlg loans of all members of a group on a specified meeting date. Mandatory Fields: calendarId and transactionDate Save Collection Sheet: This api allows the loan officer to perform bulk repayments of JLG loans for a group on its meeting date. Mandatory Fields: calendarId, transactionDate, actualDisbursementDate Optional Fields: clientsAttendance, bulkRepaymentTransaction, bulkDisbursementTransactions Unassign a Staff: Allows you to unassign the Staff. Mandatory Fields: staffId Assign a Staff: Allows you to assign Staff to an existing Group. The selected Staff should be belong to the same office (or an office higher up in the hierarchy) as this groupMandatory Fields: staffId Optional Fields: inheritStaffForClientAccounts (Optional: Boolean if true all members of the group (i.e all clients with active loans and savings ) will inherit the staffId) Close a Group: This API exists to close a group. Groups can be closed if they don\'t have any non-closed clients/loans/savingsAccounts. If the group has any active clients/loans/savingsAccount, this API will result in an error.Assign a Role: Allows you to assign a Role to an existing member of a group. We can define the different roles applicable to group members by adding code values to the pre-defined system code GROUPROLE. Example:Group leader etc. Mandatory Fields: clientId, role Unassign a Role: Allows you to unassign Roles associated tp Group members. Update a Role: Allows you to update the member Role. Mandatory Fields: role Showing request/response for Transfer Clients across groups * @summary Activate a Group | Associate Clients | Disassociate Clients | Transfer Clients across groups | Generate Collection Sheet | Save Collection Sheet | Unassign a Staff | Assign a Staff | Close a Group | Unassign a Role | Update a Role * @param {number} groupId groupId * @param {PostGroupsGroupIdRequest} postGroupsGroupIdRequest * @param {string} [command] command * @param {number} [roleId] roleId * @param {*} [options] Override http request option. * @throws {RequiredError} */ activateOrGenerateCollectionSheet: async (groupId: number, postGroupsGroupIdRequest: PostGroupsGroupIdRequest, command?: string, roleId?: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'groupId' is not null or undefined assertParamExists('activateOrGenerateCollectionSheet', 'groupId', groupId) // verify required parameter 'postGroupsGroupIdRequest' is not null or undefined assertParamExists('activateOrGenerateCollectionSheet', 'postGroupsGroupIdRequest', postGroupsGroupIdRequest) const localVarPath = `/groups/{groupId}` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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; } if (roleId !== undefined) { localVarQueryParameter['roleId'] = roleId; } 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(postGroupsGroupIdRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Creates a Group Mandatory Fields: name, officeId, active, activationDate (if active=true) Optional Fields: externalId, staffId, clientMembers * @summary Create a Group * @param {PostGroupsRequest} postGroupsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ create8: async (postGroupsRequest: PostGroupsRequest, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'postGroupsRequest' is not null or undefined assertParamExists('create8', 'postGroupsRequest', postGroupsRequest) const localVarPath = `/groups`; // 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(postGroupsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * A group can be deleted if it is in pending state and has no associations - clients, loans or savings * @summary Delete a Group * @param {number} groupId groupId * @param {*} [options] Override http request option. * @throws {RequiredError} */ delete11: async (groupId: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'groupId' is not null or undefined assertParamExists('delete11', 'groupId', groupId) const localVarPath = `/groups/{groupId}` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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) 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} [officeId] * @param {number} [staffId] * @param {string} [dateFormat] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getGroupsTemplate: async (officeId?: number, staffId?: number, dateFormat?: string, options: any = {}): Promise<RequestArgs> => { const localVarPath = `/groups/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 (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, }; }, /** * * @param {FormDataContentDisposition} [file] * @param {string} [locale] * @param {string} [dateFormat] * @param {*} [options] Override http request option. * @throws {RequiredError} */ postGroupTemplate: async (file?: FormDataContentDisposition, locale?: string, dateFormat?: string, options: any = {}): Promise<RequestArgs> => { const localVarPath = `/groups/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 (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, }; }, /** * Retrieves details of all Loan and Savings accounts associated with this group. Example Requests: groups/1/accounts groups/1/accounts?fields=loanAccounts,savingsAccounts,memberLoanAccounts, memberSavingsAccounts * @summary Retrieve Group accounts overview * @param {number} groupId groupId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveAccounts: async (groupId: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'groupId' is not null or undefined assertParamExists('retrieveAccounts', 'groupId', groupId) const localVarPath = `/groups/{groupId}/accounts` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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, }; }, /** * The default implementation of listing Groups returns 200 entries with support for pagination and sorting. Using the parameter limit with description -1 returns all entries. Example Requests: groups groups?fields=name,officeName,joinedDate groups?offset=10&limit=50 groups?orderBy=name&sortOrder=DESC * @summary List Groups * @param {number} [officeId] officeId * @param {number} [staffId] staffId * @param {string} [externalId] externalId * @param {string} [name] name * @param {string} [underHierarchy] underHierarchy * @param {boolean} [paged] paged * @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} */ retrieveAll24: async (officeId?: number, staffId?: number, externalId?: string, name?: string, underHierarchy?: string, paged?: boolean, offset?: number, limit?: number, orderBy?: string, sortOrder?: string, orphansOnly?: boolean, options: any = {}): Promise<RequestArgs> => { const localVarPath = `/groups`; // 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 (staffId !== undefined) { localVarQueryParameter['staffId'] = staffId; } if (externalId !== undefined) { localVarQueryParameter['externalId'] = externalId; } if (name !== undefined) { localVarQueryParameter['name'] = name; } if (underHierarchy !== undefined) { localVarQueryParameter['underHierarchy'] = underHierarchy; } if (paged !== undefined) { localVarQueryParameter['paged'] = paged; } 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} groupId * @param {string} [parentGSIMAccountNo] * @param {number} [parentGSIMId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveGsimAccounts: async (groupId: number, parentGSIMAccountNo?: string, parentGSIMId?: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'groupId' is not null or undefined assertParamExists('retrieveGsimAccounts', 'groupId', groupId) const localVarPath = `/groups/{groupId}/gsimaccounts` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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 (parentGSIMAccountNo !== undefined) { localVarQueryParameter['parentGSIMAccountNo'] = parentGSIMAccountNo; } if (parentGSIMId !== undefined) { localVarQueryParameter['parentGSIMId'] = parentGSIMId; } setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Retrieve group information. Example Requests: groups/1 groups/1?associations=clientMembers * @summary Retrieve a Group * @param {number} groupId groupId * @param {boolean} [staffInSelectedOfficeOnly] staffInSelectedOfficeOnly * @param {number} [roleId] roleId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveOne14: async (groupId: number, staffInSelectedOfficeOnly?: boolean, roleId?: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'groupId' is not null or undefined assertParamExists('retrieveOne14', 'groupId', groupId) const localVarPath = `/groups/{groupId}` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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; } if (roleId !== undefined) { localVarQueryParameter['roleId'] = roleId; } 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 Requests: groups/template groups/template?officeId=2 groups/template?centerId=1 groups/template?centerId=1&staffInSelectedOfficeOnly=true * @summary Retrieve Group Template * @param {number} [officeId] officeId * @param {boolean} [center] center * @param {number} [centerId] centerId * @param {string} [command] command * @param {boolean} [staffInSelectedOfficeOnly] staffInSelectedOfficeOnly * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveTemplate7: async (officeId?: number, center?: boolean, centerId?: number, command?: string, staffInSelectedOfficeOnly?: boolean, options: any = {}): Promise<RequestArgs> => { const localVarPath = `/groups/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 (center !== undefined) { localVarQueryParameter['center'] = center; } if (centerId !== undefined) { localVarQueryParameter['centerId'] = centerId; } if (command !== undefined) { localVarQueryParameter['command'] = command; } 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, }; }, /** * * @param {number} groupId * @param {string} [parentLoanAccountNo] * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveglimAccounts: async (groupId: number, parentLoanAccountNo?: string, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'groupId' is not null or undefined assertParamExists('retrieveglimAccounts', 'groupId', groupId) const localVarPath = `/groups/{groupId}/glimaccounts` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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 (parentLoanAccountNo !== undefined) { localVarQueryParameter['parentLoanAccountNo'] = parentLoanAccountNo; } setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Allows you to unassign the Staff. Mandatory Fields: staffId * @summary Unassign a Staff * @param {number} groupId groupId * @param {PostGroupsGroupIdCommandUnassignStaffRequest} postGroupsGroupIdCommandUnassignStaffRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ unassignLoanOfficer: async (groupId: number, postGroupsGroupIdCommandUnassignStaffRequest: PostGroupsGroupIdCommandUnassignStaffRequest, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'groupId' is not null or undefined assertParamExists('unassignLoanOfficer', 'groupId', groupId) // verify required parameter 'postGroupsGroupIdCommandUnassignStaffRequest' is not null or undefined assertParamExists('unassignLoanOfficer', 'postGroupsGroupIdCommandUnassignStaffRequest', postGroupsGroupIdCommandUnassignStaffRequest) const localVarPath = `/groups/{groupId}/command/unassign_staff` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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(postGroupsGroupIdCommandUnassignStaffRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Updates a Group * @summary Update a Group * @param {number} groupId groupId * @param {PutGroupsGroupIdRequest} putGroupsGroupIdRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ update12: async (groupId: number, putGroupsGroupIdRequest: PutGroupsGroupIdRequest, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'groupId' is not null or undefined assertParamExists('update12', 'groupId', groupId) // verify required parameter 'putGroupsGroupIdRequest' is not null or undefined assertParamExists('update12', 'putGroupsGroupIdRequest', putGroupsGroupIdRequest) const localVarPath = `/groups/{groupId}` .replace(`{${"groupId"}}`, encodeURIComponent(String(groupId))); // 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(putGroupsGroupIdRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * GroupsApi - functional programming interface * @export */ export const GroupsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = GroupsApiAxiosParamCreator(configuration) return { /** * Activate a Group: Groups can be created in a Pending state. This API exists to enable group activation. If the group happens to be already active this API will result in an error. Mandatory Fields: activationDate Associate Clients: This API allows to associate existing clients to a group. The clients are listed from the office to which the group is associated. If client(s) is already associated with group then API will result in an error. Mandatory Fields: clientMembers Disassociate Clients: This API allows to disassociate clients from a group. Disassociating a client with active joint liability group loans results in an error. Mandatory Fields: clientMembers Transfer Clients across groups: This API allows to transfer clients from one group to another Mandatory Fields: destinationGroupId and clients Optional Fields: inheritDestinationGroupLoanOfficer (defaults to true) and transferActiveLoans (defaults to true) Generate Collection Sheet: This API retrieves repayment details of all jlg loans of all members of a group on a specified meeting date. Mandatory Fields: calendarId and transactionDate Save Collection Sheet: This api allows the loan officer to perform bulk repayments of JLG loans for a group on its meeting date. Mandatory Fields: calendarId, transactionDate, actualDisbursementDate Optional Fields: clientsAttendance, bulkRepaymentTransaction, bulkDisbursementTransactions Unassign a Staff: Allows you to unassign the Staff. Mandatory Fields: staffId Assign a Staff: Allows you to assign Staff to an existing Group. The selected Staff should be belong to the same office (or an office higher up in the hierarchy) as this groupMandatory Fields: staffId Optional Fields: inheritStaffForClientAccounts (Optional: Boolean if true all members of the group (i.e all clients with active loans and savings ) will inherit the staffId) Close a Group: This API exists to close a group. Groups can be closed if they don\'t have any non-closed clients/loans/savingsAccounts. If the group has any active clients/loans/savingsAccount, this API will result in an error.Assign a Role: Allows you to assign a Role to an existing member of a group. We can define the different roles applicable to group members by adding code values to the pre-defined system code GROUPROLE. Example:Group leader etc. Mandatory Fields: clientId, role Unassign a Role: Allows you to unassign Roles associated tp Group members. Update a Role: Allows you to update the member Role. Mandatory Fields: role Showing request/response for Transfer Clients across groups * @summary Activate a Group | Associate Clients | Disassociate Clients | Transfer Clients across groups | Generate Collection Sheet | Save Collection Sheet | Unassign a Staff | Assign a Staff | Close a Group | Unassign a Role | Update a Role * @param {number} groupId groupId * @param {PostGroupsGroupIdRequest} postGroupsGroupIdRequest * @param {string} [command] command * @param {number} [roleId] roleId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async activateOrGenerateCollectionSheet(groupId: number, postGroupsGroupIdRequest: PostGroupsGroupIdRequest, command?: string, roleId?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostGroupsGroupIdResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.activateOrGenerateCollectionSheet(groupId, postGroupsGroupIdRequest, command, roleId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Creates a Group Mandatory Fields: name, officeId, active, activationDate (if active=true) Optional Fields: externalId, staffId, clientMembers * @summary Create a Group * @param {PostGroupsRequest} postGroupsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async create8(postGroupsRequest: PostGroupsRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostGroupsResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.create8(postGroupsRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * A group can be deleted if it is in pending state and has no associations - clients, loans or savings * @summary Delete a Group * @param {number} groupId groupId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async delete11(groupId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteGroupsGroupIdResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.delete11(groupId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {number} [officeId] * @param {number} [staffId] * @param {string} [dateFormat] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getGroupsTemplate(officeId?: number, staffId?: number, dateFormat?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getGroupsTemplate(officeId, staffId, dateFormat, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {FormDataContentDisposition} [file] * @param {string} [locale] * @param {string} [dateFormat] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async postGroupTemplate(file?: FormDataContentDisposition, locale?: string, dateFormat?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.postGroupTemplate(file, locale, dateFormat, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Retrieves details of all Loan and Savings accounts associated with this group. Example Requests: groups/1/accounts groups/1/accounts?fields=loanAccounts,savingsAccounts,memberLoanAccounts, memberSavingsAccounts * @summary Retrieve Group accounts overview * @param {number} groupId groupId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveAccounts(groupId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetGroupsGroupIdAccountsResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveAccounts(groupId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * The default implementation of listing Groups returns 200 entries with support for pagination and sorting. Using the parameter limit with description -1 returns all entries. Example Requests: groups groups?fields=name,officeName,joinedDate groups?offset=10&limit=50 groups?orderBy=name&sortOrder=DESC * @summary List Groups * @param {number} [officeId] officeId * @param {number} [staffId] staffId * @param {string} [externalId] externalId * @param {string} [name] name * @param {string} [underHierarchy] underHierarchy * @param {boolean} [paged] paged * @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 retrieveAll24(officeId?: number, staffId?: number, externalId?: string, name?: string, underHierarchy?: string, paged?: boolean, offset?: number, limit?: number, orderBy?: string, sortOrder?: string, orphansOnly?: boolean, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetGroupsResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveAll24(officeId, staffId, externalId, name, underHierarchy, paged, offset, limit, orderBy, sortOrder, orphansOnly, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {number} groupId * @param {string} [parentGSIMAccountNo] * @param {number} [parentGSIMId] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveGsimAccounts(groupId: number, parentGSIMAccountNo?: string, parentGSIMId?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveGsimAccounts(groupId, parentGSIMAccountNo, parentGSIMId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Retrieve group information. Example Requests: groups/1 groups/1?associations=clientMembers * @summary Retrieve a Group * @param {number} groupId groupId * @param {boolean} [staffInSelectedOfficeOnly] staffInSelectedOfficeOnly * @param {number} [roleId] roleId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveOne14(groupId: number, staffInSelectedOfficeOnly?: boolean, roleId?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetGroupsGroupIdResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveOne14(groupId, staffInSelectedOfficeOnly, roleId, 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 Requests: groups/template groups/template?officeId=2 groups/template?centerId=1 groups/template?centerId=1&staffInSelectedOfficeOnly=true * @summary Retrieve Group Template * @param {number} [officeId] officeId * @param {boolean} [center] center * @param {number} [centerId] centerId * @param {string} [command] command * @param {boolean} [staffInSelectedOfficeOn