omnipay-savings-sdk
Version:
Omnipay Savings SDK
134 lines (117 loc) • 2.81 kB
text/typescript
export type Grouped<T> = {
[key: string]: T[];
};
export type SuggestedPlansOptionsType = {
id: number;
name: string;
};
export interface SDKConfig {
apiKey: string;
primaryColor: string;
env: 'prod' | 'dev';
onClose?: () => void;
onTokenExpired?: () => void;
}
export interface AppProps {
config: SDKConfig;
}
export type SavingsCategoryType = {
id: number;
name: string;
interestRate: number;
isLocked: boolean | null;
lockedPenaltyFeePercentage: number | null;
minimumLockDuration: number | null;
withdrawalLimit: number | null;
proposedAmount?: number | null;
interestRange?: string | null;
};
export type InterestRateRangeType = {
min: number;
max: number;
};
export type FrequencyType =
| 'Daily'
| 'Weekly'
| 'Monthly'
| 'Save as you collect';
export type SavingsAccountListType = {
savingsId: string;
accountName: string;
interestEarned: number;
savingTarget: number;
amountSaved: number;
walletId: string;
proposedAmount?: number | null;
categoryName: string;
savingsFrequency: string;
interestEarnedInDays: number;
isLocked: boolean;
startDate?: string;
endDate?: string;
};
export type SavingsDetailType = {
savingsId: string;
accountName: string;
walletId: string;
interestEarned: number;
savingTarget: number;
accountBalance: number;
amountSaved: number;
categoryName: string;
noOfWithdrawals: number;
startDate?: string;
endDate?: string;
autoSave: boolean;
periodicSavingsAmount: number;
interestRate: number;
proposedAmount: number;
savingsFrequency: string;
savingsFrequencyId: number;
narration: string;
isInterestDisabled: boolean;
savingsPlanColor: string;
isLocked?: boolean;
interestEarnedInDays: number;
isCurrentlyLocked?: boolean;
maturityDate?: string;
};
export type DeductionNameType = 'Percentage' | 'Flat rate';
export type DeductionFrequencyType = 'One-time' | 'Reoccurring';
export type TypesOfDeductionType = {
name: DeductionNameType;
id: string;
};
export type TypesOfDeductionFrequencyType = {
name: DeductionFrequencyType;
id: string;
};
export type looseObject = {
[key: string]: any;
};
export type CustomerSavingsSummary = {
customerId: string;
totalAmountInSavingsAccount: number;
totalWithdrawnAmount: number;
totalInterestPaidOut: number;
totalPendingInterest: number;
totalAmountSaved: number;
totalInterestEarned: number;
};
export type FundSavingsParams = {
savingsId: string;
amount: number; // Amount in kobo
};
export type InterestBreakdownType = {
date: string; // ISO date string
interest: number;
balance: number;
};
export type LockedSavingsInterestRateTierType = {
id: number;
minDays: number;
maxDays: number;
interestRate: number;
description: string;
isActive: boolean;
};