@crediblex.io/fineract-api-client
Version:
TypeScript client for Fineract APIs
271 lines • 6.61 kB
TypeScript
import { Currency } from "./savingsaccounts";
/**
* Represents charge time type.
*/
export interface ChargeTimeType {
id: number;
code: string;
value: string;
}
/**
* Represents charge applies to.
*/
export interface ChargeAppliesTo {
id: number;
code: string;
value: string;
}
/**
* Represents charge calculation type.
*/
export interface ChargeCalculationType {
id: number;
code: string;
value: string;
}
/**
* Represents charge payment mode.
*/
export interface ChargePaymentMode {
id: number;
code: string;
value: string;
}
/**
* Represents tax group information.
*/
export interface TaxGroup {
id: number;
name: string;
}
/**
* Represents fee frequency information.
*/
export interface FeeFrequency {
id: number;
code: string;
value: string;
}
/**
* Represents a charge from the charges endpoint.
* This is the full charge object as returned by GET /charges.
*/
export interface Charge {
id: number;
name: string;
active: boolean;
penalty: boolean;
freeWithdrawal: boolean;
isPaymentType: boolean;
freeWithdrawalChargeFrequency: number;
restartFrequency: number;
restartFrequencyEnum: number;
currency: Currency;
amount: number;
chargeTimeType: ChargeTimeType;
chargeAppliesTo: ChargeAppliesTo;
chargeCalculationType: ChargeCalculationType;
chargePaymentMode: ChargePaymentMode;
taxGroup?: TaxGroup;
overdueInstallmentCharge: boolean;
feeInterval?: number;
feeFrequency?: FeeFrequency;
}
/**
* Represents the response when fetching all charges.
*/
export type GetChargesResponse = Charge[];
/**
* Represents optional parameters for filtering charges.
*/
export interface GetChargesParams {
/** Filter by charge applies to (e.g., 'loan', 'savings', 'lineOfCredit') */
chargeAppliesTo?: string;
/** Filter by active status */
active?: boolean;
}
/**
* Represents a status option for credit lines.
*/
export interface StatusOption {
id: number;
code: string;
value: string;
}
/**
* Represents a product type option for credit lines.
*/
export interface ProductTypeOption {
id: number;
code: string;
value: string;
}
/**
* Represents a review period option for credit lines.
*/
export interface ReviewPeriodOption {
id: number;
code: string;
value: string;
}
/**
* Represents a cash margin type option for credit lines.
*/
export interface CashMarginTypeOption {
id: number;
code: string;
value: string;
}
/**
* Represents an interest charge time option for credit lines.
*/
export interface InterestChargeTimeOption {
id: number;
code: string;
value: string;
}
/**
* Represents a loan officer for credit lines.
*/
export interface LoanOfficer {
id: number;
firstname: string;
lastname: string;
displayName: string;
officeId: number;
officeName: string;
isLoanOfficer: boolean;
isActive: boolean;
joiningDate: [number, number, number];
}
/**
* Represents the full template response for credit line creation.
*/
export interface CreditLineTemplate {
statusOptions: StatusOption[];
productTypeOptions: ProductTypeOption[];
reviewPeriodsOptions: ReviewPeriodOption[];
cashMarginTypeOptions: CashMarginTypeOption[];
interestChargeTimeOptions: InterestChargeTimeOption[];
loanOfficers: LoanOfficer[];
}
/**
* Represents an approved buyer for the credit line.
*/
export interface ApprovedBuyer {
name: string;
}
/**
* Represents a charge for the credit line.
* This extends the base Charge with additional fields specific to credit line creation.
*/
export interface CreditLineCharge extends Charge {
editableAmount: number;
}
/**
* Represents the request body for creating a credit line.
*/
export interface CreateCreditLineRequest {
productType: number;
currencyCode: string;
clientCompanyName: string;
clientContactPersonName: string;
clientContactPersonPhone: string;
clientContactPersonEmail: string;
authorizedSignatoryName: string;
authorizedSignatoryPhone: string;
authorizedSignatoryEmail: string;
virtualAccount: string;
externalId: string;
specialConditions: string;
maxCreditLimit: string;
reviewPeriod: number;
interimReviewDate: string;
annualInterestRate: number;
tenorDays: number;
advancePercentage: string;
cashMarginType: number;
cashMarginValue: number;
interestChargeTime: number;
loanOfficerId: number;
distributionPartner: string;
approvedBuyers: ApprovedBuyer[];
settlementSavingsAccountId: number | null;
charges: CreditLineCharge[];
dateFormat: string;
locale: string;
}
/**
* Represents the response from creating a credit line.
*/
export interface CreateCreditLineResponse {
resourceId: number;
}
/**
* Represents a status object for loans and credit lines.
*/
export interface Status {
id: number;
code: string;
value: string;
pendingApproval?: boolean;
waitingForDisbursal?: boolean;
active?: boolean;
closedObligationsMet?: boolean;
closedWrittenOff?: boolean;
closedRescheduled?: boolean;
closed?: boolean;
overpaid?: boolean;
}
/**
* Represents a timeline for loan events.
*/
export interface LoanTimeline {
submittedOnDate: [number, number, number];
approvedOnDate?: [number, number, number];
expectedDisbursementDate?: [number, number, number];
actualDisbursementDate?: [number, number, number];
closedOnDate?: [number, number, number];
}
/**
* Represents a loan within a credit line.
*/
export interface CreditLineLoan {
id: number;
accountNo: string;
productName: string;
status: Status;
timeline: LoanTimeline;
inArrears: boolean;
originalLoan?: number;
loanBalance?: number;
amountPaid?: number;
invoiceNumber?: string;
totalOverPaidDerived?: number;
supplierBuyerName?: string;
}
/**
* Represents a line of credit summary.
*/
export interface LineOfCredit {
id: number;
accountNumber?: string;
productType: string;
maximumAmount: number;
availableBalance: number;
consumedAmount: number;
status: Status;
externalId?: string;
}
/**
* Represents a credit line with its associated loans.
*/
export interface CreditLineWithLoans {
lineOfCredit: LineOfCredit;
loans: CreditLineLoan[];
}
/**
* Represents the response when getting all credit lines for a client.
*/
export type GetCreditLinesResponse = CreditLineWithLoans[];
//# sourceMappingURL=creditlines.d.ts.map