Last active
April 29, 2019 10:47
-
-
Save szerintedmi/d0d9bc7768192546e74e9c6580d90448 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import BigNumber from "bignumber.js"; | |
import { Contract } from "./Contract"; | |
export interface ILoanProduct { | |
id: number; | |
termInSecs: number; | |
termInDays: number; | |
termText: string; | |
interestRatePa: number; | |
discountRate: number; | |
defaultingFeePt: number; | |
collateralRatio: number; | |
minDisbursedAmount: number; | |
maxLoanAmount: number; | |
isActive: boolean; | |
calculateLoanFromCollateral(bnCollateralAmount: BigNumber): ILoanValues; | |
calculateLoanFromDisbursedAmount(disbursedAmount: number): ILoanValues; | |
} | |
export interface ILoanValues { | |
disbursedAmount: number; | |
bnCollateralAmount: BigNumber; | |
interestAmount: number; | |
bnDefaultingFeeAmount: BigNumber; | |
repayBefore: Date; | |
} | |
export class LoanManager extends Contract { | |
public async getActiveProducts(): Promise<ILoanProduct[]> {} | |
public async getAllProducts(): Promise<ILoanProduct[]> {} | |
public async getProduct(productId: number): Promise<ILoanProduct> {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment