import { Base } from './base'; export enum ContributionTypesEnum { NotSet = 'NotSet', CAL = 'CAL', CAR = 'CAR', FAC = 'FAC', FAL = 'FAL' } export enum ContributionSubTypesEnum { NotSet = 'NotSet', CAL_AL = 'CAL_AL', CAL_DR = 'CAL_DR', CAL_C = 'CAL_C', CAL_CL = 'CAL_CL', CAL_N = 'CAL_N', CAL_R = 'CAL_R', CAL_RL = 'CAL_RL', CAR_AL = 'CAR_AL', CAR_C = 'CAR_C', CAR_N = 'CAR_N', CAR_R = 'CAR_R', FAC_C = 'FAC_C', FAC_FC = 'FAC_FC', FAC_FN = 'FAC_FN', FAC_LN = 'FAC_LN', FAC_N = 'FAC_N', FAC_R = 'FAC_R', FAL_AL = 'FAL_AL', FAL_C = 'FAL_C', FAL_N = 'FAL_N', FAL_NL = 'FAL_NL', FAL_R = 'FAL_R', } export class Contribution extends Base { contributionID: string; timeStamp: number; regDate: Date; type: ContributionTypesEnum; subType: ContributionSubTypesEnum; employeeNumber: string; employeeAmount: number; companyAmount: number; employeeWithdraw: number; companyWithdraw: number; employeeSettlement: number; companySettlement: number; investmentReturn: number; constructor(data: any = null) { super(); this.contributionID = ''; this.timeStamp = 0; this.regDate = new Date(); this.type = ContributionTypesEnum.NotSet; this.subType = ContributionSubTypesEnum.NotSet; this.employeeNumber = ''; this.employeeAmount = 0; this.companyAmount = 0; this.employeeWithdraw = 0; this.companyWithdraw = 0; this.employeeSettlement = 0; this.companySettlement = 0; this.investmentReturn = 0; this.load(data); if (data) { if (data.timeStamp > 0) { let aDate: Date | null = null; aDate = new Date(); aDate.setTime(data.timeStamp); this.regDate = aDate; } } } } export class LoanTransaction extends Base { loanPaymentID: string; timeStamp: number; regDate: Date; grantTimeStamp: number; grantDate: Date; type: ContributionTypesEnum; subType: string; loanType: string; employeeNumber: string; amortization: number; interest: number; prepaymentAmortization: number; prepaymentInterest: number; loanPerformance: number; constructor(data: any = null) { super(); this.loanPaymentID = ''; this.timeStamp = 0; this.grantTimeStamp = 0; this.regDate = new Date(); this.grantDate = new Date(); this.type = ContributionTypesEnum.NotSet; this.subType = ContributionSubTypesEnum.NotSet; this.loanType = ContributionSubTypesEnum.NotSet; this.employeeNumber = ''; this.amortization = 0; this.interest = 0; this.prepaymentAmortization = 0; this.prepaymentInterest = 0; this.loanPerformance = 0; this.load(data); if (data) { if (data.timeStamp > 0) { let aDate: Date | null = null; aDate = new Date(); aDate.setTime(data.timeStamp); this.regDate = aDate; } if (data.grantTimeStamp > 0) { let aDate: Date | null = null; aDate = new Date(); aDate.setTime(data.grantTimeStamp); this.grantDate = aDate; } } } }