UNPKG

@crediblex.io/fineract-api-client

Version:
59 lines 2.92 kB
import { HttpClient } from "../utils/http-client"; import { CreateSavingsAccountRequest, CreateSavingsAccountResponse, DepositTransactionRequest, DepositTransactionResponse, SavingsTransactionTemplateResponse } from "../types/savingsaccounts"; /** * API client for Fineract Savings Accounts related operations. * It uses the HttpClient for making requests. */ export declare class FineractSavingsAccountsApi { private readonly httpClient; constructor(httpClient: HttpClient); /** * Retrieves all savings accounts from Fineract. * Corresponds to the GET /savingsaccounts endpoint. * * @returns A promise that resolves to the list of savings accounts or rejects with an error. */ getAll(): Promise<any>; /** * Retrieves a specific savings account by ID from Fineract. * Corresponds to the GET /savingsaccounts/{accountId} endpoint. * * @param accountId The ID of the savings account to retrieve. * @returns A promise that resolves to the savings account details or rejects with an error. */ getById(accountId: number): Promise<any>; /** * Creates a new savings account in Fineract. * Corresponds to the POST /savingsaccounts endpoint. * * @param accountData The data for the new savings account. * @returns A promise that resolves to the creation response or rejects with an error. */ create(accountData: CreateSavingsAccountRequest): Promise<CreateSavingsAccountResponse>; /** * Deletes a savings account from Fineract. * Corresponds to the DELETE /savingsaccounts/{accountId} endpoint. * * @param accountId The ID of the savings account to delete. * @returns A promise that resolves to the deletion response or rejects with an error. */ delete(accountId: number): Promise<any>; /** * Creates a deposit transaction for a savings account in Fineract. * Corresponds to the POST /savingsaccounts/{accountId}/transactions?command=deposit endpoint. * * @param accountId The ID of the savings account to deposit into. * @param transactionData The data for the deposit transaction. * @returns A promise that resolves to the deposit transaction response or rejects with an error. */ deposit(accountId: number, transactionData: DepositTransactionRequest): Promise<DepositTransactionResponse>; /** * Retrieves the transaction template for a savings account in Fineract. * Corresponds to the GET /savingsaccounts/{accountId}/transactions/template endpoint. * * @param accountId The ID of the savings account to get the transaction template for. * @returns A promise that resolves to the transaction template response or rejects with an error. */ getTransactionTemplate(accountId: number): Promise<SavingsTransactionTemplateResponse>; } //# sourceMappingURL=fineract-savingsaccounts-api.d.ts.map