diff --git a/src/app/app.module.ts b/src/app/app.module.ts index b5ff0ce..b5e4332 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -103,6 +103,8 @@ import { LoansAllComponent } from './loans-all/loans-all.component'; import {LenderNameService} from './service/lender-name.service'; import { LenderAaaIncomeComponent } from './pay-in/lender-aaa-income/lender-aaa-income.component'; import { LenderConnectiveIncomeComponent } from './pay-in/lender-connective-income/lender-connective-income.component'; +import { LenderResimacXlsIncomeComponent } from './pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component'; +import { LenderResimacPdfIncomeComponent } from './pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component'; @@ -175,6 +177,8 @@ export function initializeApp(appConfig: AppConfig): () => Promise { LoansAllComponent, LenderAaaIncomeComponent, LenderConnectiveIncomeComponent, + LenderResimacXlsIncomeComponent, + LenderResimacPdfIncomeComponent, ], imports: [ BrowserModule, diff --git a/src/app/models/pay-in-resimac-pdf.model.ts b/src/app/models/pay-in-resimac-pdf.model.ts new file mode 100644 index 0000000..6839825 --- /dev/null +++ b/src/app/models/pay-in-resimac-pdf.model.ts @@ -0,0 +1,76 @@ +import {PayInLenderIncomeModel} from '../abstract/pay-in-lender.income.model'; +import {PayInModel} from './pay-in.model'; +import {PayInResimacXlsModel} from './pay-in-resimac-xls.mode'; + +export class PayInResimacPdfModel extends PayInLenderIncomeModel { + + public Period: Date; + public LoanNumber: string; + public Borrower: string; + public LoanAmount: number; + public InterestRate: number; + public Margin: number; + public Settlement: Date; + public Balance: number; + public OffsetBalance: number; + public GrossManFee: number; + public IncentiveP: number; + public Months: number; + public SacrificeP: number; + public Fee: number; + public MoFee: number; + public NetManFee: number; + public IncomeAmount: number; + + constructor(payload: Partial) { + super('Resimac', payload); + if ( payload.Period !== undefined && payload.Period !== null){ + this.Period = new Date(payload.Period); + }else{ + this.Period = new Date('1800-01-01'); // some invalid date before 1900-01-01 + } + this.LoanNumber = payload.LoanNumber || ''; + this.Borrower = payload.Borrower || ''; + this.LoanAmount = payload.LoanAmount || 0; + this.InterestRate = payload.InterestRate || 0; + this.Margin = payload.Margin || 0; + if ( payload.Settlement !== undefined && payload.Settlement !== null){ + this.Settlement = new Date (payload.Settlement); + }else{ + this.Settlement = new Date('1800-01-01'); + } + this.Balance = payload.Balance || 0; + this.OffsetBalance = Math.abs(payload.OffsetBalance || 0); + this.GrossManFee = payload.GrossManFee || 0; + this.IncentiveP = payload.IncentiveP || 0; + this.Months = payload.Months || 0; + this.SacrificeP = payload.SacrificeP || 0; + this.Fee = payload.Fee || 0 ; + this.MoFee = payload.MoFee || 0; + this.NetManFee = payload.NetManFee || 0; + this.IncomeAmount = payload.IncomeAmount || 0; + + } + + public convertToPayIn(): PayInModel { + const pi = new PayInModel({}); + pi.Lender = 'Resimac'; + pi.LoanNumber = this.LoanNumber; + pi.Amount = this.LoanAmount; + pi.Settlement = this.Settlement; + pi.IncomeAmount = this.IncomeAmount; + pi.IncomeType = 'Trail'; + pi.Balance = this.Balance; + pi.OffsetBalance = -1; + pi.Ts = this.Period; + return pi; + } + + public isMatch(pi: PayInModel): boolean{ + return this.LoanNumber === pi.LoanNumber && this.LoanNumber !== '' && + this.AgencyName === pi.Lender && this.AgencyName !== '' && + this.IncomeAmount === pi.IncomeAmount && + this.Balance === pi.Balance && + 'Trail' === pi.IncomeType; + } +} diff --git a/src/app/models/pay-in-resimac-xls.mode.ts b/src/app/models/pay-in-resimac-xls.mode.ts new file mode 100644 index 0000000..0f9038f --- /dev/null +++ b/src/app/models/pay-in-resimac-xls.mode.ts @@ -0,0 +1,105 @@ +import {PayInLenderIncomeModel} from '../abstract/pay-in-lender.income.model'; +import {PayInModel} from './pay-in.model'; + +export class PayInResimacXlsModel extends PayInLenderIncomeModel { + public TRSTCD: number; + public ORGNTR: number; + public LOANNO: number; + public PORTN: string; + public BRNAMX: string; // Brower + public LNAMT: number; // Loan amount + public INTRTE: number; + public DELRTE: number; + public MARGIN: number; + public SETLDX: Date; // settled date + public LNBAL: number; + public MANFEE: number; + public RSINCP: number; + public RSSACT: number; + public RSSACP: number; + public SACAMT: number; + public MOFEE: number; + public MANTOT: number; + public NEWLON: number; + public REFADJ: number; + public NETNEW: number; + public FIXED: string; + public LNFORT: string; + public ORGNAM: string; + public LNEOM: Date; + + // Derived attributes + LoanNumber: string; + Borrower: string; + LoanAmount: number; + Balance: number; + IncomeAmount: number; + + + constructor(payload: Partial){ + super('Resimac', payload); + this.TRSTCD = payload.TRSTCD || 0 ; + this.ORGNTR = payload.ORGNTR || 0 ; + this.LOANNO = payload.LOANNO || 0 ; + this.PORTN = payload.PORTN || '' ; + this.BRNAMX = payload.BRNAMX || ''; + this.LNAMT = payload.LNAMT || 0; + this.INTRTE = payload.INTRTE || 0; + this.DELRTE = payload.DELRTE || 0; + this.MARGIN = payload.MARGIN || 0; + if ( payload.SETLDX !== undefined && payload.SETLDX !== null){ + this.SETLDX = new Date(payload.SETLDX); + }else{ + this.SETLDX = new Date('1800-01-01'); // some invalid date before 1900-01-01 + } + this.LNBAL = payload.LNBAL || 0; + this.MANFEE = payload.MANFEE || 0; + this.RSINCP = payload.RSINCP || 0; + this.RSSACT = payload.RSSACT || 0; + this.RSSACP = payload.RSSACP || 0; + this.SACAMT = payload.SACAMT || 0; + this.MOFEE = payload.MOFEE || 0; + this.MANTOT = payload.MANTOT || 0; + this.NEWLON = payload.NEWLON || 0; + this.REFADJ = payload.REFADJ || 0; + this.NETNEW = payload.NETNEW || 0; + this.FIXED = payload.FIXED || ''; + this.LNFORT = payload.LNFORT || ''; + this.ORGNAM = payload.ORGNAM || ''; + if ( payload.LNEOM !== undefined && payload.LNEOM !== null){ + this.LNEOM = new Date (payload.LNEOM); + }else{ + this.LNEOM = new Date('1800-01-01'); + } + + + // Derived attributes, but provided by Server + this.LoanNumber = payload.LoanNumber || ''; + this.Borrower = payload.Borrower || ''; + this.LoanAmount = payload.LoanAmount || 0; + this.Balance = payload.Balance || 0; + this.IncomeAmount = payload.IncomeAmount || 0; + } + + public convertToPayIn(): PayInModel { + const pi = new PayInModel({}); + pi.Lender = 'Resimac'; + pi.LoanNumber = this.LoanNumber; + pi.Amount = this.LoanAmount; + pi.Settlement = this.SETLDX; + pi.IncomeAmount = this.IncomeAmount; + pi.IncomeType = 'Trail'; + pi.Balance = this.Balance; + pi.OffsetBalance = -1; + pi.Ts = this.LNEOM; + return pi; + } + + public isMatch(pi: PayInModel): boolean { + return this.LoanNumber === pi.LoanNumber && this.LoanNumber !== '' && + this.AgencyName === pi.Lender && this.AgencyName !== '' && + this.IncomeAmount === pi.IncomeAmount && + this.Balance === pi.Balance && + 'Trail' === pi.IncomeType; + } +} diff --git a/src/app/models/upload.analysis.model.ts b/src/app/models/upload.analysis.model.ts index 7dcb16e..1d99d55 100644 --- a/src/app/models/upload.analysis.model.ts +++ b/src/app/models/upload.analysis.model.ts @@ -2,6 +2,8 @@ import {UploadMetaModel} from './uploadMetaModel'; import {PayInModel} from './pay-in.model'; import {PayInAAARowModel} from './Pay.In.AAA.Row.model'; import {PayInConnectiveModel} from './pay-in-connective.model'; +import {PayInResimacXlsModel} from './pay-in-resimac-xls.mode'; +import {PayInResimacPdfModel} from './pay-in-resimac-pdf.model'; @@ -13,6 +15,8 @@ export class UploadAnalysisModel { public AAA?: PayInAAARowModel[]; public Connective?: PayInConnectiveModel[]; + public ResimacXls?: PayInResimacXlsModel[]; + public ResimacPdf?: PayInResimacPdfModel[]; public IsDuplicate: boolean; public Uid?: string; // client side unique id when upload @@ -42,9 +46,17 @@ export class UploadAnalysisModel { } this.Connective = []; - if ( payload.Connective ) { + if ( Array.isArray(payload.Connective) ) { payload.Connective.forEach( v => { this.Connective.push(new PayInConnectiveModel(v)); }); } + this.ResimacXls = []; + if ( Array.isArray(payload.ResimacXls) ) { + payload.ResimacXls.forEach( v => { this.ResimacXls.push(new PayInResimacXlsModel(v)); }); + } + this.ResimacPdf = []; + if (Array.isArray(payload.ResimacPdf)){ + payload.ResimacPdf.forEach( v => { this.ResimacPdf.push(new PayInResimacPdfModel(v)); }); + } this.IsDuplicate = payload.IsDuplicate || false; this.Uid = payload.Uid || '' ; diff --git a/src/app/pay-in/lender-aaa-income/lender-aaa-income.component.scss b/src/app/pay-in/lender-aaa-income/lender-aaa-income.component.scss index e69de29..5b7a4d8 100644 --- a/src/app/pay-in/lender-aaa-income/lender-aaa-income.component.scss +++ b/src/app/pay-in/lender-aaa-income/lender-aaa-income.component.scss @@ -0,0 +1,3 @@ +kendo-grid{ + height: 100%; +} diff --git a/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.html b/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.html new file mode 100644 index 0000000..ba5b61f --- /dev/null +++ b/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.html @@ -0,0 +1,33 @@ + + + {{this.AgencyName}} + + + + + + + + + + + + + + + + + + + + + + + + + + {{ dataItem.matchedPayIn === -1? 'Not matched': dataItem.matchedPayIn.Id}} + + + + diff --git a/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.scss b/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.scss new file mode 100644 index 0000000..5b7a4d8 --- /dev/null +++ b/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.scss @@ -0,0 +1,3 @@ +kendo-grid{ + height: 100%; +} diff --git a/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.spec.ts b/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.spec.ts new file mode 100644 index 0000000..c34fa1b --- /dev/null +++ b/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LenderResimacPdfIncomeComponent } from './lender-resimac-pdf-income.component'; + +describe('LenderResimacPdfIncomeComponent', () => { + let component: LenderResimacPdfIncomeComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ LenderResimacPdfIncomeComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(LenderResimacPdfIncomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.ts b/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.ts new file mode 100644 index 0000000..f0c9573 --- /dev/null +++ b/src/app/pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component.ts @@ -0,0 +1,25 @@ +import {Component, OnChanges, OnInit} from '@angular/core'; +import {LenderIncomeAbstractDirective} from '../../abstract/lender-income-abstract.directive'; +import {PayInResimacPdfModel} from '../../models/pay-in-resimac-pdf.model'; + +@Component({ + selector: 'app-lender-resimac-pdf-income', + templateUrl: './lender-resimac-pdf-income.component.html', + styleUrls: ['./lender-resimac-pdf-income.component.scss'] +}) +export class LenderResimacPdfIncomeComponent extends LenderIncomeAbstractDirective implements OnInit, OnChanges { + + constructor() { super('Resimac'); } + + ngOnInit(): void { + this.analysis.ResimacPdf.forEach(v => { + v.matchedPayIn = this.matchPayIn(v); + this.data.push(new PayInResimacPdfModel(v)); + }); + } + + ngOnChanges(changes): void { + super.OnChanges(changes); + } + +} diff --git a/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.html b/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.html new file mode 100644 index 0000000..9788f19 --- /dev/null +++ b/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.html @@ -0,0 +1,46 @@ + + + {{this.AgencyName}} + + + + + + + + + + + + + + {{ dataItem.matchedPayIn === -1? 'Not matched': dataItem.matchedPayIn.Id}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.scss b/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.scss new file mode 100644 index 0000000..5b7a4d8 --- /dev/null +++ b/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.scss @@ -0,0 +1,3 @@ +kendo-grid{ + height: 100%; +} diff --git a/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.spec.ts b/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.spec.ts new file mode 100644 index 0000000..4841b92 --- /dev/null +++ b/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LenderResimacXlsIncomeComponent } from './lender-resimac-xls-income.component'; + +describe('LenderResimacXlsIncomeComponent', () => { + let component: LenderResimacXlsIncomeComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ LenderResimacXlsIncomeComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(LenderResimacXlsIncomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.ts b/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.ts new file mode 100644 index 0000000..e36dc7c --- /dev/null +++ b/src/app/pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component.ts @@ -0,0 +1,25 @@ +import {Component, OnChanges, OnInit} from '@angular/core'; +import {LenderIncomeAbstractDirective} from '../../abstract/lender-income-abstract.directive'; +import {PayInResimacXlsModel} from '../../models/pay-in-resimac-xls.mode'; + +@Component({ + selector: 'app-lender-resimac-xls-income', + templateUrl: './lender-resimac-xls-income.component.html', + styleUrls: ['./lender-resimac-xls-income.component.scss'] +}) +export class LenderResimacXlsIncomeComponent extends LenderIncomeAbstractDirective implements OnInit, OnChanges { + + constructor() { super('Resimac'); } + + ngOnInit(): void { + this.analysis.ResimacXls.forEach(v => { + v.matchedPayIn = this.matchPayIn(v); + this.data.push(new PayInResimacXlsModel(v)); + }); + } + + ngOnChanges(changes): void { + super.OnChanges(changes); + } + +} diff --git a/src/app/pay-in/pay-in.component.ts b/src/app/pay-in/pay-in.component.ts index ece6753..3af40b4 100644 --- a/src/app/pay-in/pay-in.component.ts +++ b/src/app/pay-in/pay-in.component.ts @@ -161,6 +161,9 @@ export class PayInComponent implements OnInit { const Loan = this.filterLoan.Id !== '' ? this.filterLoan : dataItem.Loan; const UploadMeta = this.filterUploadMeta.Id !== 0 ? this.filterUploadMeta : dataItem.UploadMeta ; + this.showBalance = dataItem.Balance >= 0 ; + this.showOffsetBalance = dataItem.OffsetBalance >= 0 ; + return new FormGroup({ Id: new FormControl({value: dataItem.Id, disabled: true}, Validators.required), Lender: new FormControl({value: dataItem.Lender, disabled: Loan.Id !== '' }, Validators.required), diff --git a/src/app/upload-detail/upload-detail.component.html b/src/app/upload-detail/upload-detail.component.html index 0fc38fb..bb5e2f3 100644 --- a/src/app/upload-detail/upload-detail.component.html +++ b/src/app/upload-detail/upload-detail.component.html @@ -53,17 +53,28 @@
AI has no results
- - - + + + +
diff --git a/src/app/upload-detail/upload-detail.component.ts b/src/app/upload-detail/upload-detail.component.ts index 233d6ab..d2f10fd 100644 --- a/src/app/upload-detail/upload-detail.component.ts +++ b/src/app/upload-detail/upload-detail.component.ts @@ -46,7 +46,7 @@ export class UploadDetailComponent implements OnInit, AfterViewInit { public tabText: string[] = ['Preview', 'Content', 'Analysis']; public tabTitle: string[] = this.tabText; - + public LenderFormat: string; constructor(private us: UploadAttachService, private actRoute: ActivatedRoute, private router: Router) { this.uploadAsPicUrl = location.origin + 'assets/img/no_preview.jpg'; @@ -81,6 +81,7 @@ export class UploadDetailComponent implements OnInit, AfterViewInit { resp => { this.ua = new UploadAnalysisModel(resp); this.uploadId = this.ua.Id; + this.setLenderFormat(resp); this.analysisIsDone = true; }, err => { this.analysisIsDone = true; @@ -89,6 +90,18 @@ export class UploadDetailComponent implements OnInit, AfterViewInit { } ); } + + private setLenderFormat( payload: Partial): void { + this.LenderFormat = this.ua.Lender; + if ( payload.Lender === 'Resimac' ){ + if ( Array.isArray(payload.ResimacPdf) ) { + this.LenderFormat = 'ResimacPdf'; + }else if (Array.isArray(payload.ResimacXls) ) { + this.LenderFormat = 'ResimacXls'; + } + } + } + private loadUploadMeta(): void { this.us.getUploadMeta(this.uploadId).subscribe( resp => {