11import { Component , Input , OnInit } from '@angular/core' ;
2- import { UntypedFormBuilder , UntypedFormGroup , Validators , ReactiveFormsModule } from '@angular/forms' ;
3- import { ActivatedRoute , Router , RouterLink } from '@angular/router' ;
2+ import { UntypedFormBuilder , UntypedFormGroup , Validators } from '@angular/forms' ;
3+ import { ActivatedRoute , Router } from '@angular/router' ;
44import { Dates } from 'app/core/utils/dates' ;
5- import { DropdownOptions } from 'app/core/utils/dropdownOptions' ;
65import { LoansService } from 'app/loans/loans.service' ;
76import { SettingsService } from 'app/settings/settings.service' ;
87import { OptionData } from 'app/shared/models/option-data.model' ;
@@ -23,7 +22,9 @@ export class LoanReagingComponent implements OnInit {
2322 /** Repayment Loan Form */
2423 reagingLoanForm : UntypedFormGroup ;
2524
26- frequencyOptions : OptionData [ ] = [ ] ;
25+ reAgeReasonOptions : any [ ] = [ ] ;
26+ periodFrequencyOptions : OptionData [ ] = [ ] ;
27+ reAgeInterestHandlingOptions : OptionData [ ] = [ ] ;
2728
2829 /** Minimum Date allowed. */
2930 minDate = new Date ( 2000 , 0 , 1 ) ;
@@ -35,16 +36,19 @@ export class LoanReagingComponent implements OnInit {
3536 private route : ActivatedRoute ,
3637 private router : Router ,
3738 private settingsService : SettingsService ,
38- private dropdownOptions : DropdownOptions ,
3939 private loanService : LoansService ,
4040 private dateUtils : Dates
4141 ) {
4242 this . loanId = this . route . snapshot . params [ 'loanId' ] ;
43- this . frequencyOptions = this . dropdownOptions . retrievePeriodFrequencyTypeOptions ( false ) ;
4443 }
4544
4645 ngOnInit ( ) : void {
4746 this . maxDate = this . settingsService . maxFutureDate ;
47+
48+ this . reAgeReasonOptions = this . dataObject . reAgeReasonOptions ;
49+ this . reAgeInterestHandlingOptions = this . dataObject . reAgeInterestHandlingOptions ;
50+ this . periodFrequencyOptions = this . dataObject . periodFrequencyOptions ;
51+
4852 this . createReagingLoanForm ( ) ;
4953 }
5054
@@ -66,8 +70,13 @@ export class LoanReagingComponent implements OnInit {
6670 ,
6771 Validators . required
6872 ] ,
73+ reAgeInterestHandling : [
74+ this . reAgeInterestHandlingOptions [ 0 ] ,
75+ Validators . required
76+ ] ,
6977 note : '' ,
70- externalId : ''
78+ externalId : '' ,
79+ reasonCodeValueId : null
7180 } ) ;
7281 }
7382
0 commit comments