@crediblex.io/fineract-api-client
Version:
TypeScript client for Fineract APIs
77 lines • 3.59 kB
TypeScript
import { HttpClient } from "../utils/http-client";
import { CalculateLoanRepaymentScheduleRequest, CalculateLoanRepaymentScheduleResponse, CreateLoanAccountRequest, CreateLoanAccountResponse, ApproveLoanAccountRequest, ApproveLoanAccountResponse } from "../types/loansaccounts";
/**
* API client for Fineract Loan Accounts related operations.
* It uses the HttpClient for making requests.
*/
export declare class FineractLoansAccountsApi {
private readonly httpClient;
constructor(httpClient: HttpClient);
/**
* Retrieves all loan accounts from Fineract.
* Corresponds to the GET /loans endpoint.
*
* @returns A promise that resolves to the list of loan accounts or rejects with an error.
*/
getAll(): Promise<any>;
/**
* Retrieves a specific loan account by ID from Fineract.
* Corresponds to the GET /loans/{loanId} endpoint.
*
* @param loanId The ID of the loan account to retrieve.
* @returns A promise that resolves to the loan account details or rejects with an error.
*/
getById(loanId: number): Promise<any>;
/**
* Creates a new loan account in Fineract.
* Corresponds to the POST /loans endpoint.
*
* @param loanData The data for the new loan account.
* @returns A promise that resolves to the creation response or rejects with an error.
*/
create(loanData: CreateLoanAccountRequest): Promise<CreateLoanAccountResponse>;
/**
* Updates a loan account in Fineract.
* Corresponds to the PUT /loans/{loanId} endpoint.
*
* @param loanId The ID of the loan account to update.
* @param loanData The updated data for the loan account.
* @returns A promise that resolves to the update response or rejects with an error.
*/
update(loanId: number, loanData: any): Promise<any>;
/**
* Deletes a loan account from Fineract.
* Corresponds to the DELETE /loans/{loanId} endpoint.
*
* @param loanId The ID of the loan account to delete.
* @returns A promise that resolves to the deletion response or rejects with an error.
*/
delete(loanId: number): Promise<any>;
/**
* Calculates and retrieves the repayment schedule for a loan account.
* Corresponds to the GET /loans?command=calculateLoanSchedule endpoint.
*
* @param loanData The loan data for which to calculate the repayment schedule.
* @returns A promise that resolves to the calculated loan schedule or rejects with an error.
*/
getRepaymentSchedule(loanData: CalculateLoanRepaymentScheduleRequest): Promise<CalculateLoanRepaymentScheduleResponse>;
/**
* Retrieves a specific loan account summary by ID from Fineract.
* Corresponds to the GET /loans/{loanId} endpoint.
*
* @param loanId The ID of the loan account to retrieve summary for.
* @returns A promise that resolves to the loan account details or rejects with an error.
*/
getSummaryById(loanId: number): Promise<any>;
getRepaymentScheduleById(loanId: number): Promise<any>;
/**
* Approves a loan account in Fineract.
* Corresponds to the POST /loans/{loanId}?command=approve endpoint.
*
* @param loanId The ID of the loan account to approve.
* @param approvalData The data for approving the loan account.
* @returns A promise that resolves to the approval response or rejects with an error.
*/
approve(loanId: number, approvalData: ApproveLoanAccountRequest): Promise<ApproveLoanAccountResponse>;
}
//# sourceMappingURL=fineract-loansaccounts-api.d.ts.map