import { Base } from './base'; import { Dictionary } from './dictionary'; import { PayrollDate } from './payrollDates'; import { EmployeeMin } from './employeeMin'; import { PeriodBase } from './period'; export enum LoanStatusEnum { Active = 'active', Denied = 'denied', Expired = 'expired', Review = 'review' } export enum LoanTypeEnum { UpFront = 'UpFront', FixedRate = 'FixedRate', DebtConsolidation = 'VariableRate' } export class LoanScheduleDate extends PayrollDate { comments: string; paid: boolean; capital: number; insurance: number; insuranceTax: number; interest: number; interestPercentage: number; tax: number; taxPercentage: number; skipped: boolean; constructor(data: any | null = null) { super(); this.comments = ''; this.paid = false; this.capital = 0; this.insurance = 0; this.insuranceTax = 0; this.interest = 0; this.interestPercentage = 0; this.tax = 0; this.taxPercentage = 0; this.skipped = false; this.load(data); } } export class Loan extends Base { loanID: string; createdAt: Date; employeeNumber: string; interestPercentage: number; interestAmount: number; scheduleDates: Dictionary; comment: string; requestedAmount: number; requestedNumberOfPayments: number; period: PeriodBase; approvedBy: EmployeeMin; employeeRef: EmployeeMin; requestedBy: EmployeeMin; status: string; active: boolean; type: string; typeID: string; restructuredID: string; ///////////////////////////////// maxAmountAllowed: number; constructor(data: any | null = null) { super(); this.loanID = ''; this.restructuredID = ''; this.createdAt = new Date(); this.interestPercentage = 0; this.interestAmount = 0; this.scheduleDates = new Dictionary(LoanScheduleDate); this.comment = ''; this.maxAmountAllowed = 0; this.approvedBy = new EmployeeMin(); this.employeeRef = new EmployeeMin(); this.requestedBy = new EmployeeMin(); this.requestedAmount = 0; this.requestedNumberOfPayments = 1; this.status = ''; this.active = false; this.type = ''; this.typeID = ''; this.period = new PeriodBase(); this.load(data); } }