Merge pull request #2714 from alberto-art3ch/WEB-352/re-amortization-interest-handling-configuration
WEB-352: Re-Amortization Interest Handling configuration
This commit is contained in:
@@ -81,6 +81,8 @@ export class LoanActionButtonResolver {
|
||||
return this.loansService.getLoanActionTemplate(loanId, 'buyDownFee');
|
||||
} else if (loanActionButton === 'Re-Age') {
|
||||
return this.loansService.getLoanActionTemplate(loanId, 'reAge');
|
||||
} else if (loanActionButton === 'Re-Amortize') {
|
||||
return this.loansService.getLoanActionTemplate(loanId, 'reAmortization');
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
+32
-1
@@ -2,10 +2,34 @@
|
||||
<mat-card>
|
||||
<form [formGroup]="reamortizeLoanForm" (ngSubmit)="submit()">
|
||||
<mat-card-content>
|
||||
<div class="layout-column">
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.Interest Handling' | translate }}</mat-label>
|
||||
<mat-select formControlName="reAmortizationInterestHandling">
|
||||
<mat-option
|
||||
*ngFor="
|
||||
let reAmortizationInterestHandlingOption of reAmortizationInterestHandlingOptions;
|
||||
trackBy: trackByInterestHandlingOption
|
||||
"
|
||||
[value]="reAmortizationInterestHandlingOption.id"
|
||||
>
|
||||
{{ reAmortizationInterestHandlingOption.value | translateKey: 'catalogs' }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="layout-column">
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.Reason' | translate }}</mat-label>
|
||||
<input matInput formControlName="note" />
|
||||
<mat-select formControlName="reasonCodeValueId">
|
||||
<mat-option
|
||||
*ngFor="let reAmortizationReasonOption of reAmortizationReasonOptions; trackBy: trackByReasonOption"
|
||||
[value]="reAmortizationReasonOption.id"
|
||||
>
|
||||
{{ reAmortizationReasonOption.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +40,13 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="layout-column">
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
|
||||
<input matInput formControlName="note" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
|
||||
<button type="button" mat-raised-button [routerLink]="['../../general']">
|
||||
{{ 'labels.buttons.Cancel' | translate }}
|
||||
|
||||
+21
-2
@@ -1,7 +1,9 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { CodeValue } from 'app/shared/models/general.model';
|
||||
import { OptionData } from 'app/shared/models/option-data.model';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
|
||||
@Component({
|
||||
@@ -18,6 +20,8 @@ export class LoanReamortizeComponent implements OnInit {
|
||||
loanId: string;
|
||||
/** ReAmortize Loan Form */
|
||||
reamortizeLoanForm: UntypedFormGroup;
|
||||
reAmortizationReasonOptions: CodeValue[] = [];
|
||||
reAmortizationInterestHandlingOptions: OptionData[] = [];
|
||||
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
@@ -29,11 +33,18 @@ export class LoanReamortizeComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.reAmortizationReasonOptions = this.dataObject?.reAmortizationReasonOptions || [];
|
||||
this.reAmortizationInterestHandlingOptions = this.dataObject?.reAmortizationInterestHandlingOptions || [];
|
||||
|
||||
this.createReAmortizeLoanForm();
|
||||
}
|
||||
|
||||
createReAmortizeLoanForm() {
|
||||
this.reamortizeLoanForm = this.formBuilder.group({
|
||||
reAmortizationInterestHandling: [
|
||||
this.reAmortizationInterestHandlingOptions[0] || null
|
||||
],
|
||||
reasonCodeValueId: null,
|
||||
note: '',
|
||||
externalId: ''
|
||||
});
|
||||
@@ -45,4 +56,12 @@ export class LoanReamortizeComponent implements OnInit {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
trackByInterestHandlingOption(index: number, option: OptionData): string | number {
|
||||
return option.id ?? index;
|
||||
}
|
||||
|
||||
trackByReasonOption(index: number, option: CodeValue): string | number {
|
||||
return option.id ?? index;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user