UNPKG

@crediblex.io/fineract-api-client

Version:
95 lines 4.64 kB
import { HttpClient } from "../utils/http-client"; import { CreateCreditLineRequest, CreateCreditLineResponse, GetCreditLinesResponse, GetChargesResponse, GetChargesParams, CreditLineTemplate, StatusOption, ProductTypeOption, ReviewPeriodOption, CashMarginTypeOption, InterestChargeTimeOption, LoanOfficer } from "../types/creditlines"; /** * API client for Fineract Credit Lines related operations. * It uses the HttpClient for making requests. */ export declare class FineractCreditLinesApi { private readonly httpClient; constructor(httpClient: HttpClient); /** * Creates a new credit line for a client in Fineract. * Corresponds to the POST /clients/{clientId}/creditlines endpoint. * * @param clientId The ID of the client to create the credit line for. * @param creditLineData The data for the new credit line. * @returns A promise that resolves to the creation response or rejects with an error. */ createCreditLine(clientId: number, creditLineData: CreateCreditLineRequest): Promise<CreateCreditLineResponse>; /** * Retrieves all credit lines for a specific client. * Corresponds to the GET /clients/{clientId}/creditlines endpoint. * * @param clientId The ID of the client to get credit lines for. * @returns A promise that resolves to the list of credit lines with their associated loans or rejects with an error. */ getCreditLines(clientId: number): Promise<GetCreditLinesResponse>; /** * Retrieves all available charges from Fineract. * Corresponds to the GET /charges endpoint. * This is useful for discovering which charges can be applied to credit lines. * * @param params Optional parameters for filtering charges. * @returns A promise that resolves to the list of charges or rejects with an error. */ getCharges(params?: GetChargesParams): Promise<GetChargesResponse>; /** * Retrieves charges that are specifically applicable to Line of Credit. * This is a convenience method that filters charges for credit line use. * * @returns A promise that resolves to the list of credit line applicable charges or rejects with an error. */ getCreditLineCharges(): Promise<GetChargesResponse>; /** * Retrieves the credit line template for a specific client. * Corresponds to the GET /clients/{clientId}/creditlines/template endpoint. * This provides all the available options for creating a credit line. * * @param clientId The ID of the client to get the template for. * @returns A promise that resolves to the credit line template or rejects with an error. */ getCreditLineTemplate(clientId: number): Promise<CreditLineTemplate>; /** * Retrieves status options for credit lines. * * @param clientId The ID of the client to get options for. * @returns A promise that resolves to the list of status options. */ getCreditLineStatusOptions(clientId: number): Promise<StatusOption[]>; /** * Retrieves product type options for credit lines. * * @param clientId The ID of the client to get options for. * @returns A promise that resolves to the list of product type options. */ getCreditLineProductTypeOptions(clientId: number): Promise<ProductTypeOption[]>; /** * Retrieves review period options for credit lines. * * @param clientId The ID of the client to get options for. * @returns A promise that resolves to the list of review period options. */ getCreditLineReviewPeriodOptions(clientId: number): Promise<ReviewPeriodOption[]>; /** * Retrieves cash margin type options for credit lines. * * @param clientId The ID of the client to get options for. * @returns A promise that resolves to the list of cash margin type options. */ getCreditLineCashMarginTypeOptions(clientId: number): Promise<CashMarginTypeOption[]>; /** * Retrieves interest charge time options for credit lines. * * @param clientId The ID of the client to get options for. * @returns A promise that resolves to the list of interest charge time options. */ getCreditLineInterestChargeTimeOptions(clientId: number): Promise<InterestChargeTimeOption[]>; /** * Retrieves loan officers available for credit lines. * * @param clientId The ID of the client to get options for. * @returns A promise that resolves to the list of loan officers. */ getCreditLineLoanOfficers(clientId: number): Promise<LoanOfficer[]>; } //# sourceMappingURL=fineract-creditlines-api.d.ts.map