build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
+6
-5
@@ -14,13 +14,14 @@ import { FixedDepositsService } from '../fixed-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class FixedDepositsAccountActionsResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SavingsService} SavingsService Savings service.
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service.
|
||||
*/
|
||||
constructor(private savingsService: SavingsService,
|
||||
private fixedDepositsService: FixedDepositsService) { }
|
||||
constructor(
|
||||
private savingsService: SavingsService,
|
||||
private fixedDepositsService: FixedDepositsService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Returns the Fixed deposits account actions data.
|
||||
@@ -29,7 +30,8 @@ export class FixedDepositsAccountActionsResolver implements Resolve<Object> {
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const actionName = route.paramMap.get('name');
|
||||
const fixedDepositAccountId = route.paramMap.get('fixedDepositAccountId') || route.parent.parent.paramMap.get('fixedDepositAccountId');
|
||||
const fixedDepositAccountId =
|
||||
route.paramMap.get('fixedDepositAccountId') || route.parent.parent.paramMap.get('fixedDepositAccountId');
|
||||
switch (actionName) {
|
||||
case 'Add Charge':
|
||||
return this.savingsService.getSavingsChargeTemplateResource(fixedDepositAccountId);
|
||||
@@ -41,5 +43,4 @@ export class FixedDepositsAccountActionsResolver implements Resolve<Object> {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-3
@@ -13,11 +13,10 @@ import { FixedDepositsService } from '../fixed-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class FixedDepositsAccountAndTemplateResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits service.
|
||||
*/
|
||||
constructor(private fixedDepositsService: FixedDepositsService) { }
|
||||
constructor(private fixedDepositsService: FixedDepositsService) {}
|
||||
|
||||
/**
|
||||
* Returns the Fixed Deposits Account Template.
|
||||
@@ -28,5 +27,4 @@ export class FixedDepositsAccountAndTemplateResolver implements Resolve<Object>
|
||||
const fixedDepositAccountId = route.paramMap.get('fixedDepositAccountId');
|
||||
return this.fixedDepositsService.getFixedDepositsAccountAndTemplate(fixedDepositAccountId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-3
@@ -13,11 +13,10 @@ import { FixedDepositsService } from '../fixed-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class FixedDepositsAccountTemplateResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits service.
|
||||
*/
|
||||
constructor(private fixedDepositsService: FixedDepositsService) { }
|
||||
constructor(private fixedDepositsService: FixedDepositsService) {}
|
||||
|
||||
/**
|
||||
* Returns the Fixed Deposits Account Template.
|
||||
@@ -28,5 +27,4 @@ export class FixedDepositsAccountTemplateResolver implements Resolve<Object> {
|
||||
const clientId = route.parent.parent.paramMap.get('clientId');
|
||||
return this.fixedDepositsService.getFixedDepositsAccountTemplate(clientId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-3
@@ -13,11 +13,10 @@ import { FixedDepositsService } from '../fixed-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class FixedDepositsAccountTransactionResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {FixedDepositsService} fixedDepositsService Savings service.
|
||||
*/
|
||||
constructor(private fixedDepositsService: FixedDepositsService) { }
|
||||
constructor(private fixedDepositsService: FixedDepositsService) {}
|
||||
|
||||
/**
|
||||
* Returns the Fixed Deposits Account Transaction data.
|
||||
@@ -29,5 +28,4 @@ export class FixedDepositsAccountTransactionResolver implements Resolve<Object>
|
||||
const transactionId = route.paramMap.get('id');
|
||||
return this.fixedDepositsService.getFixedDepositsAccountTransaction(fixedDepositAccountId, transactionId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-3
@@ -13,11 +13,10 @@ import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits
|
||||
*/
|
||||
@Injectable()
|
||||
export class FixedDepositsAccountViewResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits service.
|
||||
*/
|
||||
constructor(private fixedDepositsService: FixedDepositsService) { }
|
||||
constructor(private fixedDepositsService: FixedDepositsService) {}
|
||||
|
||||
/**
|
||||
* Returns the Fixed Deposits Account data.
|
||||
@@ -28,5 +27,4 @@ export class FixedDepositsAccountViewResolver implements Resolve<Object> {
|
||||
const fixedDepositAccountId = route.paramMap.get('fixedDepositAccountId');
|
||||
return this.fixedDepositsService.getFixedDepositsAccountData(fixedDepositAccountId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('CreateFixedDepositAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CreateFixedDepositAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CreateFixedDepositAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+26
-15
@@ -22,15 +22,18 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./create-fixed-deposit-account.component.scss']
|
||||
})
|
||||
export class CreateFixedDepositAccountComponent {
|
||||
|
||||
/** Fixed Deposits Account Details Step */
|
||||
@ViewChild(FixedDepositAccountDetailsStepComponent, { static: true }) fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent;
|
||||
@ViewChild(FixedDepositAccountDetailsStepComponent, { static: true })
|
||||
fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent;
|
||||
/** Fixed Deposits Account Terms Step */
|
||||
@ViewChild(FixedDepositAccountTermsStepComponent, { static: true }) fixedDepositAccountTermsStep: FixedDepositAccountTermsStepComponent;
|
||||
@ViewChild(FixedDepositAccountTermsStepComponent, { static: true })
|
||||
fixedDepositAccountTermsStep: FixedDepositAccountTermsStepComponent;
|
||||
/** Fixed Deposits Account Settings Step */
|
||||
@ViewChild(FixedDepositAccountSettingsStepComponent, { static: true }) fixedDepositAccountSettingsStep: FixedDepositAccountSettingsStepComponent;
|
||||
@ViewChild(FixedDepositAccountSettingsStepComponent, { static: true })
|
||||
fixedDepositAccountSettingsStep: FixedDepositAccountSettingsStepComponent;
|
||||
/** Fixed Deposits Account Charges Step */
|
||||
@ViewChild(FixedDepositAccountChargesStepComponent, { static: true }) fixedDepositAccountChargesStep: FixedDepositAccountChargesStepComponent;
|
||||
@ViewChild(FixedDepositAccountChargesStepComponent, { static: true })
|
||||
fixedDepositAccountChargesStep: FixedDepositAccountChargesStepComponent;
|
||||
|
||||
/** Fixed Deposits Account Template */
|
||||
fixedDepositsAccountTemplate: any;
|
||||
@@ -45,11 +48,13 @@ export class CreateFixedDepositAccountComponent {
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { fixedDepositsAccountTemplate: any }) => {
|
||||
this.fixedDepositsAccountTemplate = data.fixedDepositsAccountTemplate;
|
||||
});
|
||||
@@ -103,7 +108,7 @@ export class CreateFixedDepositAccountComponent {
|
||||
...this.fixedDepositsAccountDetailsStep.fixedDepositAccountDetails,
|
||||
...this.fixedDepositAccountTermsStep.fixedDepositAccountTerms,
|
||||
...this.fixedDepositAccountSettingsStep.fixedDepositAccountSettings,
|
||||
...this.fixedDepositAccountChargesStep.fixedDepositAccountCharges,
|
||||
...this.fixedDepositAccountChargesStep.fixedDepositAccountCharges
|
||||
};
|
||||
}
|
||||
|
||||
@@ -121,18 +126,24 @@ export class CreateFixedDepositAccountComponent {
|
||||
chargeId: charge.id,
|
||||
amount: charge.amount,
|
||||
dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat),
|
||||
feeOnMonthDay: charge.feeOnMonthDay && this.dateUtils.formatDate([2000].concat(charge.feeOnMonthDay), monthDayFormat),
|
||||
feeOnMonthDay:
|
||||
charge.feeOnMonthDay && this.dateUtils.formatDate([2000].concat(charge.feeOnMonthDay), monthDayFormat),
|
||||
feeInterval: charge.feeInterval
|
||||
})),
|
||||
submittedOnDate: this.dateUtils.formatDate(this.fixedDepositAccount.submittedOnDate, dateFormat),
|
||||
charts: [{chartSlabs: this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs}],
|
||||
charts: [{ chartSlabs: this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs }],
|
||||
dateFormat,
|
||||
monthDayFormat,
|
||||
locale
|
||||
};
|
||||
this.fixedDepositsService.createFixedDepositAccount(fixedDepositAccount).subscribe((response: any) => {
|
||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||
this.router.navigate(
|
||||
[
|
||||
'../',
|
||||
response.resourceId
|
||||
],
|
||||
{ relativeTo: this.route }
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('EditFixedDepositAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditFixedDepositAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [EditFixedDepositAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+25
-20
@@ -23,15 +23,18 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./edit-fixed-deposit-account.component.scss']
|
||||
})
|
||||
export class EditFixedDepositAccountComponent {
|
||||
|
||||
/** Fixed Deposits Account Details Step */
|
||||
@ViewChild(FixedDepositAccountDetailsStepComponent, { static: true }) fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent;
|
||||
@ViewChild(FixedDepositAccountDetailsStepComponent, { static: true })
|
||||
fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent;
|
||||
/** Fixed Deposits Account Terms Step */
|
||||
@ViewChild(FixedDepositAccountTermsStepComponent, { static: true }) fixedDepositAccountTermsStep: FixedDepositAccountTermsStepComponent;
|
||||
@ViewChild(FixedDepositAccountTermsStepComponent, { static: true })
|
||||
fixedDepositAccountTermsStep: FixedDepositAccountTermsStepComponent;
|
||||
/** Fixed Deposits Account Settings Step */
|
||||
@ViewChild(FixedDepositAccountSettingsStepComponent, { static: true }) fixedDepositAccountSettingsStep: FixedDepositAccountSettingsStepComponent;
|
||||
@ViewChild(FixedDepositAccountSettingsStepComponent, { static: true })
|
||||
fixedDepositAccountSettingsStep: FixedDepositAccountSettingsStepComponent;
|
||||
/** Fixed Deposits Account Charges Step */
|
||||
@ViewChild(FixedDepositAccountChargesStepComponent, { static: true }) fixedDepositAccountChargesStep: FixedDepositAccountChargesStepComponent;
|
||||
@ViewChild(FixedDepositAccountChargesStepComponent, { static: true })
|
||||
fixedDepositAccountChargesStep: FixedDepositAccountChargesStepComponent;
|
||||
|
||||
/** Fixed Deposits Account Template */
|
||||
fixedDepositsAccountAndTemplate: any;
|
||||
@@ -48,11 +51,13 @@ export class EditFixedDepositAccountComponent {
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { fixedDepositsAccountAndTemplate: any }) => {
|
||||
this.fixedDepositsAccountAndTemplate = data.fixedDepositsAccountAndTemplate;
|
||||
});
|
||||
@@ -96,12 +101,10 @@ export class EditFixedDepositAccountComponent {
|
||||
this.fixedDepositAccountDetailsForm.valid &&
|
||||
this.fixedDepositAccountTermsForm.valid &&
|
||||
this.fixedDepositAccountSettingsForm.valid &&
|
||||
(
|
||||
!this.fixedDepositAccountDetailsForm.pristine ||
|
||||
(!this.fixedDepositAccountDetailsForm.pristine ||
|
||||
!this.fixedDepositAccountTermsForm.pristine ||
|
||||
!this.fixedDepositAccountSettingsForm.pristine ||
|
||||
!this.fixedDepositAccountChargesStep.pristine
|
||||
)
|
||||
!this.fixedDepositAccountChargesStep.pristine)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -131,18 +134,20 @@ export class EditFixedDepositAccountComponent {
|
||||
chargeId: charge.id,
|
||||
amount: charge.amount,
|
||||
dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat),
|
||||
feeOnMonthDay: charge.feeOnMonthDay && this.dateUtils.formatDate([2000].concat(charge.feeOnMonthDay), monthDayFormat),
|
||||
feeOnMonthDay:
|
||||
charge.feeOnMonthDay && this.dateUtils.formatDate([2000].concat(charge.feeOnMonthDay), monthDayFormat),
|
||||
feeInterval: charge.feeInterval
|
||||
})),
|
||||
submittedOnDate: this.dateUtils.formatDate(this.fixedDepositAccount.submittedOnDate, dateFormat),
|
||||
charts: [{chartSlabs: this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs}],
|
||||
charts: [{ chartSlabs: this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs }],
|
||||
dateFormat,
|
||||
monthDayFormat,
|
||||
locale
|
||||
};
|
||||
this.fixedDepositsService.updateFixedDepositAccount(this.fixedDepositsAccountAndTemplate.id, fixedDepositAccount).subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
this.fixedDepositsService
|
||||
.updateFixedDepositAccount(this.fixedDepositsAccountAndTemplate.id, fixedDepositAccount)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('FixedDepositAccountChargesStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FixedDepositAccountChargesStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [FixedDepositAccountChargesStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+25
-12
@@ -23,7 +23,6 @@ import { Charge, Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./fixed-deposit-account-charges-step.component.scss']
|
||||
})
|
||||
export class FixedDepositAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
|
||||
/** Fixed deposits account template */
|
||||
@Input() fixedDepositsAccountTemplate: any;
|
||||
/** Fixed deposits account and product template */
|
||||
@@ -38,7 +37,15 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
||||
/** Charges Data Source */
|
||||
chargesDataSource: {}[] = [];
|
||||
/** Charges table columns */
|
||||
displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery', 'action'];
|
||||
displayedColumns: string[] = [
|
||||
'name',
|
||||
'chargeCalculationType',
|
||||
'amount',
|
||||
'chargeTimeType',
|
||||
'date',
|
||||
'repaymentsEvery',
|
||||
'action'
|
||||
];
|
||||
/** For Edit Fixed Deposits Account Form */
|
||||
isChargesPatched = false;
|
||||
/** Component is pristine if there has been no changes by user interaction */
|
||||
@@ -49,14 +56,17 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
||||
* @param {Dates} dateUtils Date Utils
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(public dialog: MatDialog,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) { }
|
||||
constructor(
|
||||
public dialog: MatDialog,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.chargesDataSource = [];
|
||||
if (this.fixedDepositsAccountTemplate.id && this.fixedDepositsAccountTemplate.charges) {
|
||||
this.chargesDataSource = this.fixedDepositsAccountTemplate.charges.map((charge: any) => ({...charge, id: charge.chargeId})) || [];
|
||||
this.chargesDataSource =
|
||||
this.fixedDepositsAccountTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +79,9 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
||||
}
|
||||
}
|
||||
if (this.fixedDepositsAccountProductTemplate) {
|
||||
this.chargeData = this.fixedDepositsAccountProductTemplate.chargeOptions
|
||||
.filter((c: Charge) => c.currency.code === this.currency.code);
|
||||
this.chargeData = this.fixedDepositsAccountProductTemplate.chargeOptions.filter(
|
||||
(c: Charge) => c.currency.code === this.currency.code
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +106,8 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
||||
value: charge.amount,
|
||||
type: 'number',
|
||||
required: false
|
||||
}),
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: 'Edit Charge Amount',
|
||||
@@ -125,7 +137,8 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
||||
value: charge.dueDate || charge.feeOnMonthDay || '',
|
||||
type: 'datetime-local',
|
||||
required: false
|
||||
}),
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: 'Edit Charge Date',
|
||||
@@ -166,7 +179,8 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
||||
value: charge.feeInterval,
|
||||
type: 'text',
|
||||
required: false
|
||||
}),
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: 'Edit Charge Fee Interval',
|
||||
@@ -200,5 +214,4 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
||||
get fixedDepositAccountCharges() {
|
||||
return { charges: this.chargesDataSource };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('FixedDepositAccountDetailsStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FixedDepositAccountDetailsStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [FixedDepositAccountDetailsStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+23
-14
@@ -15,7 +15,6 @@ import { FixedDepositsService } from '../../fixed-deposits.service';
|
||||
styleUrls: ['./fixed-deposit-account-details-step.component.scss']
|
||||
})
|
||||
export class FixedDepositAccountDetailsStepComponent implements OnInit {
|
||||
|
||||
/** Fixed Deposits Account Template */
|
||||
@Input() fixedDepositsAccountTemplate: any;
|
||||
|
||||
@@ -43,9 +42,11 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.createFixedDepositsAccountDetailsForm();
|
||||
}
|
||||
|
||||
@@ -56,10 +57,11 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
|
||||
this.productData = this.fixedDepositsAccountTemplate.productOptions;
|
||||
if (this.fixedDepositsAccountTemplate.depositProductId) {
|
||||
this.fixedDepositAccountDetailsForm.patchValue({
|
||||
'productId': this.fixedDepositsAccountTemplate.depositProductId,
|
||||
'submittedOnDate': this.fixedDepositsAccountTemplate.timeline.submittedOnDate
|
||||
&& new Date(this.fixedDepositsAccountTemplate.timeline.submittedOnDate),
|
||||
'externalId': this.fixedDepositsAccountTemplate.externalId || '',
|
||||
productId: this.fixedDepositsAccountTemplate.depositProductId,
|
||||
submittedOnDate:
|
||||
this.fixedDepositsAccountTemplate.timeline.submittedOnDate &&
|
||||
new Date(this.fixedDepositsAccountTemplate.timeline.submittedOnDate),
|
||||
externalId: this.fixedDepositsAccountTemplate.externalId || ''
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -70,10 +72,16 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
|
||||
*/
|
||||
createFixedDepositsAccountDetailsForm() {
|
||||
this.fixedDepositAccountDetailsForm = this.formBuilder.group({
|
||||
'productId': ['', Validators.required],
|
||||
'submittedOnDate': ['', Validators.required],
|
||||
'fieldOfficerId': [''],
|
||||
'externalId': ['']
|
||||
productId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
submittedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
fieldOfficerId: [''],
|
||||
externalId: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -88,7 +96,9 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
|
||||
this.isProductSelected = true;
|
||||
this.fieldOfficerData = response.fieldOfficerOptions;
|
||||
if (!this.isFieldOfficerPatched && this.fixedDepositsAccountTemplate.fieldOfficerId) {
|
||||
this.fixedDepositAccountDetailsForm.get('fieldOfficerId').patchValue(this.fixedDepositsAccountTemplate.fieldOfficerId);
|
||||
this.fixedDepositAccountDetailsForm
|
||||
.get('fieldOfficerId')
|
||||
.patchValue(this.fixedDepositsAccountTemplate.fieldOfficerId);
|
||||
this.isFieldOfficerPatched = true;
|
||||
} else {
|
||||
this.fixedDepositAccountDetailsForm.get('fieldOfficerId').patchValue('');
|
||||
@@ -109,5 +119,4 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
|
||||
}
|
||||
return fixedDepositAccountDetails;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('FixedDepositAccountInterestRateChartStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FixedDepositAccountInterestRateChartStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [FixedDepositAccountInterestRateChartStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+18
-7
@@ -14,12 +14,11 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
|
||||
trigger('expandChartSlab', [
|
||||
state('collapsed', style({ height: '0px', minHeight: '0' })),
|
||||
state('expanded', style({ height: '*' })),
|
||||
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))
|
||||
])
|
||||
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))])
|
||||
|
||||
]
|
||||
})
|
||||
export class FixedDepositAccountInterestRateChartStepComponent implements OnChanges {
|
||||
|
||||
/** Fixed deposits account template */
|
||||
@Input() fixedDepositsAccountTemplate: any;
|
||||
/** Fixed deposits account and product template */
|
||||
@@ -28,9 +27,22 @@ export class FixedDepositAccountInterestRateChartStepComponent implements OnChan
|
||||
/** Interest Rate Chart Data */
|
||||
interestRateChartData: any = [];
|
||||
/** Columns to be displayed in interest rate chart table. */
|
||||
chartSlabsDisplayedColumns: any[] = ['period', 'amountRange', 'interest', 'description', 'actions'];
|
||||
chartSlabsDisplayedColumns: any[] = [
|
||||
'period',
|
||||
'amountRange',
|
||||
'interest',
|
||||
'description',
|
||||
'actions'
|
||||
];
|
||||
/** Columns to be displayed in incentives sub-table. */
|
||||
incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount'];
|
||||
incentivesDisplayedColumns: string[] = [
|
||||
'entityType',
|
||||
'attributeName',
|
||||
'conditionType',
|
||||
'attributeValue',
|
||||
'incentiveType',
|
||||
'amount'
|
||||
];
|
||||
/** Additional Column to disblac incentives table */
|
||||
chartSlabsIncentivesDisplayedColumns: string[] = ['incentives'];
|
||||
/** Expand Chart Slab Index used in the view */
|
||||
@@ -39,7 +51,7 @@ export class FixedDepositAccountInterestRateChartStepComponent implements OnChan
|
||||
/** Interest Rate charts table reference */
|
||||
@ViewChild('chartsTable', { static: true }) chartsTableRef: MatTable<Element>;
|
||||
|
||||
constructor() { }
|
||||
constructor() {}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.fixedDepositsAccountProductTemplate) {
|
||||
@@ -47,5 +59,4 @@ export class FixedDepositAccountInterestRateChartStepComponent implements OnChan
|
||||
this.chartsTableRef.renderRows();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('FixedDepositAccountPreviewStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FixedDepositAccountPreviewStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [FixedDepositAccountPreviewStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+26
-8
@@ -13,12 +13,11 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
|
||||
trigger('expandChartSlab', [
|
||||
state('collapsed', style({ height: '0px', minHeight: '0' })),
|
||||
state('expanded', style({ height: '*' })),
|
||||
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))
|
||||
])
|
||||
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))])
|
||||
|
||||
]
|
||||
})
|
||||
export class FixedDepositAccountPreviewStepComponent implements OnChanges {
|
||||
|
||||
/** Fixed Deposits Account Template */
|
||||
@Input() fixedDepositsAccountTemplate: any;
|
||||
/** Fixed Deposits Account Product Template */
|
||||
@@ -27,13 +26,33 @@ export class FixedDepositAccountPreviewStepComponent implements OnChanges {
|
||||
@Input() fixedDepositAccountData: any;
|
||||
|
||||
/** Charges Displayed Columns */
|
||||
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery'];
|
||||
chargesDisplayedColumns: string[] = [
|
||||
'name',
|
||||
'chargeCalculationType',
|
||||
'amount',
|
||||
'chargeTimeType',
|
||||
'date',
|
||||
'repaymentsEvery'
|
||||
];
|
||||
/** Interest Rate Chart Data */
|
||||
interestRateChartData: any = [];
|
||||
/** Columns to be displayed in interest rate chart table. */
|
||||
chartSlabsDisplayedColumns: any[] = ['period', 'amountRange', 'interest', 'description', 'actions'];
|
||||
chartSlabsDisplayedColumns: any[] = [
|
||||
'period',
|
||||
'amountRange',
|
||||
'interest',
|
||||
'description',
|
||||
'actions'
|
||||
];
|
||||
/** Columns to be displayed in incentives sub-table. */
|
||||
incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount'];
|
||||
incentivesDisplayedColumns: string[] = [
|
||||
'entityType',
|
||||
'attributeName',
|
||||
'conditionType',
|
||||
'attributeValue',
|
||||
'incentiveType',
|
||||
'amount'
|
||||
];
|
||||
/** Additional Column to disblac incentives table */
|
||||
chartSlabsIncentivesDisplayedColumns: string[] = ['incentives'];
|
||||
/** Expand Chart Slab Index used in the view */
|
||||
@@ -42,12 +61,11 @@ export class FixedDepositAccountPreviewStepComponent implements OnChanges {
|
||||
/** Form submission event */
|
||||
@Output() submitEvent = new EventEmitter();
|
||||
|
||||
constructor() { }
|
||||
constructor() {}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.fixedDepositsAccountProductTemplate) {
|
||||
this.interestRateChartData = this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('FixedDepositAccountSettingsStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FixedDepositAccountSettingsStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [FixedDepositAccountSettingsStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+74
-38
@@ -13,7 +13,6 @@ import { OptionData } from 'app/shared/models/option-data.model';
|
||||
styleUrls: ['./fixed-deposit-account-settings-step.component.scss']
|
||||
})
|
||||
export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChanges {
|
||||
|
||||
/** Fixed deposits account template */
|
||||
@Input() fixedDepositsAccountTemplate: any;
|
||||
/** Fixed deposits account and product template */
|
||||
@@ -40,8 +39,10 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.createFixedDepositAccountSettingsForm();
|
||||
this.buildDependencies();
|
||||
}
|
||||
@@ -49,28 +50,46 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
ngOnChanges() {
|
||||
if (this.fixedDepositsAccountProductTemplate) {
|
||||
this.fixedDepositAccountSettingsForm.patchValue({
|
||||
'minDepositTerm': this.fixedDepositsAccountProductTemplate.minDepositTerm,
|
||||
'minDepositTermTypeId': this.fixedDepositsAccountProductTemplate.minDepositTermType ? this.fixedDepositsAccountProductTemplate.minDepositTermType.id : '',
|
||||
'inMultiplesOfDepositTerm': this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTerm,
|
||||
'inMultiplesOfDepositTermTypeId': this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTermType ? this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTermType.id : '',
|
||||
'maxDepositTerm': this.fixedDepositsAccountProductTemplate.maxDepositTerm,
|
||||
'maxDepositTermTypeId': this.fixedDepositsAccountProductTemplate.maxDepositTermType ? this.fixedDepositsAccountProductTemplate.maxDepositTermType.id : '',
|
||||
'preClosurePenalApplicable': this.fixedDepositsAccountProductTemplate.preClosurePenalApplicable,
|
||||
'preClosurePenalInterest': this.fixedDepositsAccountProductTemplate.preClosurePenalInterest,
|
||||
'preClosurePenalInterestOnTypeId': this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType ? this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType.id : '',
|
||||
'maturityInstructionId': this.fixedDepositsAccountProductTemplate.maturityInstructionId
|
||||
minDepositTerm: this.fixedDepositsAccountProductTemplate.minDepositTerm,
|
||||
minDepositTermTypeId: this.fixedDepositsAccountProductTemplate.minDepositTermType
|
||||
? this.fixedDepositsAccountProductTemplate.minDepositTermType.id
|
||||
: '',
|
||||
inMultiplesOfDepositTerm: this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTerm,
|
||||
inMultiplesOfDepositTermTypeId: this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTermType
|
||||
? this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTermType.id
|
||||
: '',
|
||||
maxDepositTerm: this.fixedDepositsAccountProductTemplate.maxDepositTerm,
|
||||
maxDepositTermTypeId: this.fixedDepositsAccountProductTemplate.maxDepositTermType
|
||||
? this.fixedDepositsAccountProductTemplate.maxDepositTermType.id
|
||||
: '',
|
||||
preClosurePenalApplicable: this.fixedDepositsAccountProductTemplate.preClosurePenalApplicable,
|
||||
preClosurePenalInterest: this.fixedDepositsAccountProductTemplate.preClosurePenalInterest,
|
||||
preClosurePenalInterestOnTypeId: this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType
|
||||
? this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType.id
|
||||
: '',
|
||||
maturityInstructionId: this.fixedDepositsAccountProductTemplate.maturityInstructionId
|
||||
});
|
||||
if (this.fixedDepositsAccountProductTemplate.withHoldTax) {
|
||||
this.fixedDepositAccountSettingsForm.addControl('withHoldTax', new UntypedFormControl(false));
|
||||
this.fixedDepositAccountSettingsForm.get('withHoldTax').valueChanges.subscribe((value: boolean) => {
|
||||
if (value) {
|
||||
this.fixedDepositAccountSettingsForm.addControl('taxGroupId', new UntypedFormControl({ value: '', disabled: true }));
|
||||
this.fixedDepositAccountSettingsForm.get('taxGroupId').patchValue(this.fixedDepositsAccountProductTemplate.taxGroup && this.fixedDepositsAccountProductTemplate.taxGroup.name);
|
||||
this.fixedDepositAccountSettingsForm.addControl(
|
||||
'taxGroupId',
|
||||
new UntypedFormControl({ value: '', disabled: true })
|
||||
);
|
||||
this.fixedDepositAccountSettingsForm
|
||||
.get('taxGroupId')
|
||||
.patchValue(
|
||||
this.fixedDepositsAccountProductTemplate.taxGroup &&
|
||||
this.fixedDepositsAccountProductTemplate.taxGroup.name
|
||||
);
|
||||
} else {
|
||||
this.fixedDepositAccountSettingsForm.removeControl('taxGroupId');
|
||||
}
|
||||
});
|
||||
this.fixedDepositAccountSettingsForm.get('withHoldTax').patchValue(this.fixedDepositsAccountTemplate.withHoldTax);
|
||||
this.fixedDepositAccountSettingsForm
|
||||
.get('withHoldTax')
|
||||
.patchValue(this.fixedDepositsAccountTemplate.withHoldTax);
|
||||
} else {
|
||||
this.fixedDepositAccountSettingsForm.removeControl('withHoldTax');
|
||||
}
|
||||
@@ -82,9 +101,11 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
if (this.fixedDepositsAccountTemplate) {
|
||||
this.fixedDepositAccountSettingsForm.patchValue({
|
||||
'lockinPeriodFrequency': this.fixedDepositsAccountTemplate.lockinPeriodFrequency,
|
||||
'lockinPeriodFrequencyType': this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType && this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType.id,
|
||||
'transferInterestToSavings': this.fixedDepositsAccountTemplate.transferInterestToSavings
|
||||
lockinPeriodFrequency: this.fixedDepositsAccountTemplate.lockinPeriodFrequency,
|
||||
lockinPeriodFrequencyType:
|
||||
this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType &&
|
||||
this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType.id,
|
||||
transferInterestToSavings: this.fixedDepositsAccountTemplate.transferInterestToSavings
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -94,19 +115,19 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
*/
|
||||
createFixedDepositAccountSettingsForm() {
|
||||
this.fixedDepositAccountSettingsForm = this.formBuilder.group({
|
||||
'lockinPeriodFrequency': [''],
|
||||
'lockinPeriodFrequencyType': [''],
|
||||
'minDepositTerm': [{value: '', disabled: true}],
|
||||
'minDepositTermTypeId': [{ value: '', disabled: true }],
|
||||
'inMultiplesOfDepositTerm': [{ value: '', disabled: true }],
|
||||
'inMultiplesOfDepositTermTypeId': [{ value: '', disabled: true }],
|
||||
'maxDepositTerm': [{ value: '', disabled: true }],
|
||||
'maxDepositTermTypeId': [{ value: '', disabled: true }],
|
||||
'transferInterestToSavings': [false],
|
||||
'preClosurePenalApplicable': [{ value: '', disabled: true }],
|
||||
'preClosurePenalInterest': [{ value: '', disabled: true }],
|
||||
'preClosurePenalInterestOnTypeId': [{ value: '', disabled: true }],
|
||||
'maturityInstructionId': ['']
|
||||
lockinPeriodFrequency: [''],
|
||||
lockinPeriodFrequencyType: [''],
|
||||
minDepositTerm: [{ value: '', disabled: true }],
|
||||
minDepositTermTypeId: [{ value: '', disabled: true }],
|
||||
inMultiplesOfDepositTerm: [{ value: '', disabled: true }],
|
||||
inMultiplesOfDepositTermTypeId: [{ value: '', disabled: true }],
|
||||
maxDepositTerm: [{ value: '', disabled: true }],
|
||||
maxDepositTermTypeId: [{ value: '', disabled: true }],
|
||||
transferInterestToSavings: [false],
|
||||
preClosurePenalApplicable: [{ value: '', disabled: true }],
|
||||
preClosurePenalInterest: [{ value: '', disabled: true }],
|
||||
preClosurePenalInterestOnTypeId: [{ value: '', disabled: true }],
|
||||
maturityInstructionId: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -116,16 +137,31 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
buildDependencies() {
|
||||
this.fixedDepositAccountSettingsForm.get('transferInterestToSavings').valueChanges.subscribe((value: boolean) => {
|
||||
if (value) {
|
||||
this.fixedDepositAccountSettingsForm.addControl('linkAccountId', new UntypedFormControl('', Validators.required));
|
||||
this.fixedDepositAccountSettingsForm.get('linkAccountId').patchValue(this.fixedDepositsAccountTemplate.linkedAccount && this.fixedDepositsAccountTemplate.linkedAccount.id);
|
||||
this.fixedDepositAccountSettingsForm.addControl(
|
||||
'linkAccountId',
|
||||
new UntypedFormControl('', Validators.required)
|
||||
);
|
||||
this.fixedDepositAccountSettingsForm
|
||||
.get('linkAccountId')
|
||||
.patchValue(
|
||||
this.fixedDepositsAccountTemplate.linkedAccount && this.fixedDepositsAccountTemplate.linkedAccount.id
|
||||
);
|
||||
} else {
|
||||
this.fixedDepositAccountSettingsForm.removeControl('linkAccountId');
|
||||
}
|
||||
});
|
||||
this.fixedDepositAccountSettingsForm.get('maturityInstructionId').valueChanges.subscribe((value: number) => {
|
||||
if (value > 100) {
|
||||
this.fixedDepositAccountSettingsForm.addControl('transferToSavingsId', new UntypedFormControl('', Validators.required));
|
||||
this.fixedDepositAccountSettingsForm.get('transferToSavingsId').patchValue(this.fixedDepositsAccountTemplate.transferToSavingsId && this.fixedDepositsAccountTemplate.transferToSavingsId.id);
|
||||
this.fixedDepositAccountSettingsForm.addControl(
|
||||
'transferToSavingsId',
|
||||
new UntypedFormControl('', Validators.required)
|
||||
);
|
||||
this.fixedDepositAccountSettingsForm
|
||||
.get('transferToSavingsId')
|
||||
.patchValue(
|
||||
this.fixedDepositsAccountTemplate.transferToSavingsId &&
|
||||
this.fixedDepositsAccountTemplate.transferToSavingsId.id
|
||||
);
|
||||
} else {
|
||||
this.fixedDepositAccountSettingsForm.removeControl('transferToSavingsId');
|
||||
}
|
||||
@@ -139,7 +175,8 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
this.lockinPeriodFrequencyTypeData = this.fixedDepositsAccountProductTemplate.lockinPeriodFrequencyTypeOptions;
|
||||
this.periodFrequencyTypeData = this.fixedDepositsAccountProductTemplate.periodFrequencyTypeOptions;
|
||||
this.savingsAccountsData = this.fixedDepositsAccountProductTemplate.savingsAccounts;
|
||||
this.preClosurePenalInterestOnTypeData = this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnTypeOptions;
|
||||
this.preClosurePenalInterestOnTypeData =
|
||||
this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnTypeOptions;
|
||||
this.maturityInstructionOptions = this.fixedDepositsAccountProductTemplate.maturityInstructionOptions;
|
||||
}
|
||||
|
||||
@@ -155,5 +192,4 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
}
|
||||
return fixedDepositAccountSettings;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('FixedDepositAccountTermsStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FixedDepositAccountTermsStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [FixedDepositAccountTermsStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+55
-29
@@ -1,6 +1,6 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, Input, OnChanges } from '@angular/core';
|
||||
import { UntypedFormGroup, UntypedFormBuilder, Validators} from '@angular/forms';
|
||||
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Currency } from 'app/shared/models/general.model';
|
||||
|
||||
@@ -13,7 +13,6 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./fixed-deposit-account-terms-step.component.scss']
|
||||
})
|
||||
export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
|
||||
/** Fixed deposits account template */
|
||||
@Input() fixedDepositsAccountTemplate: any;
|
||||
/** Fixed deposits account and product template */
|
||||
@@ -33,7 +32,7 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges
|
||||
interestCalculationTypeData: any;
|
||||
/** Interest Calculation Days in Year Data */
|
||||
interestCalculationDaysInYearTypeData: any;
|
||||
/** Period Frequency Type Data */
|
||||
/** Period Frequency Type Data */
|
||||
periodFrequencyTypeData: any;
|
||||
currency: Currency | null = null;
|
||||
|
||||
@@ -41,8 +40,10 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.createFixedDepositsAccountTermsForm();
|
||||
}
|
||||
|
||||
@@ -57,13 +58,15 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
if (this.fixedDepositsAccountTemplate.id) {
|
||||
this.fixedDepositAccountTermsForm.patchValue({
|
||||
'interestCompoundingPeriodType': this.fixedDepositsAccountTemplate.interestCompoundingPeriodType.id,
|
||||
'interestPostingPeriodType': this.fixedDepositsAccountTemplate.interestPostingPeriodType.id,
|
||||
'interestCalculationType': this.fixedDepositsAccountTemplate.interestCalculationType.id,
|
||||
'interestCalculationDaysInYearType': this.fixedDepositsAccountTemplate.interestCalculationDaysInYearType.id,
|
||||
'depositAmount': this.fixedDepositsAccountTemplate.depositAmount ? this.fixedDepositsAccountTemplate.depositAmount : 0,
|
||||
'depositPeriod': this.fixedDepositsAccountTemplate.depositPeriod,
|
||||
'depositPeriodFrequencyId': this.fixedDepositsAccountTemplate.depositPeriodFrequency.id,
|
||||
interestCompoundingPeriodType: this.fixedDepositsAccountTemplate.interestCompoundingPeriodType.id,
|
||||
interestPostingPeriodType: this.fixedDepositsAccountTemplate.interestPostingPeriodType.id,
|
||||
interestCalculationType: this.fixedDepositsAccountTemplate.interestCalculationType.id,
|
||||
interestCalculationDaysInYearType: this.fixedDepositsAccountTemplate.interestCalculationDaysInYearType.id,
|
||||
depositAmount: this.fixedDepositsAccountTemplate.depositAmount
|
||||
? this.fixedDepositsAccountTemplate.depositAmount
|
||||
: 0,
|
||||
depositPeriod: this.fixedDepositsAccountTemplate.depositPeriod,
|
||||
depositPeriodFrequencyId: this.fixedDepositsAccountTemplate.depositPeriodFrequency.id
|
||||
});
|
||||
console.log(this.fixedDepositAccountTermsForm.value);
|
||||
}
|
||||
@@ -74,13 +77,34 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges
|
||||
*/
|
||||
createFixedDepositsAccountTermsForm() {
|
||||
this.fixedDepositAccountTermsForm = this.formBuilder.group({
|
||||
'interestCompoundingPeriodType': ['', Validators.required],
|
||||
'interestPostingPeriodType': ['', Validators.required],
|
||||
'interestCalculationType': ['', Validators.required],
|
||||
'interestCalculationDaysInYearType': ['', Validators.required],
|
||||
'depositAmount': [0, Validators.required],
|
||||
'depositPeriod': ['', Validators.required],
|
||||
'depositPeriodFrequencyId': ['', Validators.required]
|
||||
interestCompoundingPeriodType: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
interestPostingPeriodType: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
interestCalculationType: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
interestCalculationDaysInYearType: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
depositAmount: [
|
||||
0,
|
||||
Validators.required
|
||||
],
|
||||
depositPeriod: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
depositPeriodFrequencyId: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -88,20 +112,23 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges
|
||||
* Sets all select dropdown options.
|
||||
*/
|
||||
setOptions() {
|
||||
this.interestCompoundingPeriodTypeData = this.fixedDepositsAccountProductTemplate.interestCompoundingPeriodTypeOptions;
|
||||
this.interestCompoundingPeriodTypeData =
|
||||
this.fixedDepositsAccountProductTemplate.interestCompoundingPeriodTypeOptions;
|
||||
this.interestPostingPeriodTypeData = this.fixedDepositsAccountProductTemplate.interestPostingPeriodTypeOptions;
|
||||
this.interestCalculationTypeData = this.fixedDepositsAccountProductTemplate.interestCalculationTypeOptions;
|
||||
this.interestCalculationDaysInYearTypeData = this.fixedDepositsAccountProductTemplate.interestCalculationDaysInYearTypeOptions;
|
||||
this.interestCalculationDaysInYearTypeData =
|
||||
this.fixedDepositsAccountProductTemplate.interestCalculationDaysInYearTypeOptions;
|
||||
this.periodFrequencyTypeData = this.fixedDepositsAccountProductTemplate.periodFrequencyTypeOptions;
|
||||
if (!this.fixedDepositsAccountTemplate.id) {
|
||||
this.fixedDepositAccountTermsForm.patchValue({
|
||||
'interestCompoundingPeriodType': this.fixedDepositsAccountProductTemplate.interestCompoundingPeriodType.id,
|
||||
'interestPostingPeriodType': this.fixedDepositsAccountProductTemplate.interestPostingPeriodType.id,
|
||||
'interestCalculationType': this.fixedDepositsAccountProductTemplate.interestCalculationType.id,
|
||||
'interestCalculationDaysInYearType': this.fixedDepositsAccountProductTemplate.interestCalculationDaysInYearType.id,
|
||||
'depositAmount': this.fixedDepositsAccountProductTemplate.depositAmount,
|
||||
'depositPeriod': this.fixedDepositsAccountProductTemplate.minDepositTerm,
|
||||
'depositPeriodFrequencyId': this.fixedDepositsAccountProductTemplate.minDepositTermType.id,
|
||||
interestCompoundingPeriodType: this.fixedDepositsAccountProductTemplate.interestCompoundingPeriodType.id,
|
||||
interestPostingPeriodType: this.fixedDepositsAccountProductTemplate.interestPostingPeriodType.id,
|
||||
interestCalculationType: this.fixedDepositsAccountProductTemplate.interestCalculationType.id,
|
||||
interestCalculationDaysInYearType:
|
||||
this.fixedDepositsAccountProductTemplate.interestCalculationDaysInYearType.id,
|
||||
depositAmount: this.fixedDepositsAccountProductTemplate.depositAmount,
|
||||
depositPeriod: this.fixedDepositsAccountProductTemplate.minDepositTerm,
|
||||
depositPeriodFrequencyId: this.fixedDepositsAccountProductTemplate.minDepositTermType.id
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -118,5 +145,4 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges
|
||||
}
|
||||
return fixedDepositAccountTerms;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ChargesTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ChargesTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ChargesTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+31
-21
@@ -30,7 +30,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./charges-tab.component.scss']
|
||||
})
|
||||
export class ChargesTabComponent implements OnInit {
|
||||
|
||||
/** Fixed Deposits Account Data */
|
||||
fixedDepositsAccountData: any;
|
||||
/** Charges Data */
|
||||
@@ -66,12 +65,14 @@ export class ChargesTabComponent implements OnInit {
|
||||
* @param {Dates} dateUtils Date Utils.
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private savingsService: SavingsService,
|
||||
private route: ActivatedRoute,
|
||||
private dateUtils: Dates,
|
||||
private router: Router,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private savingsService: SavingsService,
|
||||
private route: ActivatedRoute,
|
||||
private dateUtils: Dates,
|
||||
private router: Router,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => {
|
||||
this.fixedDepositsAccountData = data.fixedDepositsAccountData;
|
||||
this.chargesData = this.fixedDepositsAccountData.charges;
|
||||
@@ -79,7 +80,7 @@ export class ChargesTabComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
const activeCharges = this.chargesData ? this.chargesData.filter(charge => charge.isActive) : [];
|
||||
const activeCharges = this.chargesData ? this.chargesData.filter((charge) => charge.isActive) : [];
|
||||
this.dataSource = new MatTableDataSource(activeCharges);
|
||||
}
|
||||
|
||||
@@ -89,10 +90,10 @@ export class ChargesTabComponent implements OnInit {
|
||||
toggleCharges() {
|
||||
this.showInactiveCharges = !this.showInactiveCharges;
|
||||
if (!this.showInactiveCharges) {
|
||||
const activeCharges = this.chargesData.filter(charge => charge.isActive);
|
||||
const activeCharges = this.chargesData.filter((charge) => charge.isActive);
|
||||
this.dataSource.data = activeCharges;
|
||||
} else {
|
||||
const inActiveCharges = this.chargesData.filter(charge => !charge.isActive);
|
||||
const inActiveCharges = this.chargesData.filter((charge) => !charge.isActive);
|
||||
this.dataSource.data = inActiveCharges;
|
||||
}
|
||||
this.chargesTableRef.renderRows();
|
||||
@@ -118,6 +119,7 @@ export class ChargesTabComponent implements OnInit {
|
||||
type: 'date',
|
||||
required: true
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: `Pay Charge ${chargeId}`,
|
||||
@@ -135,7 +137,8 @@ export class ChargesTabComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.savingsService.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'paycharge', dataObject, chargeId)
|
||||
this.savingsService
|
||||
.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'paycharge', dataObject, chargeId)
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
@@ -151,7 +154,8 @@ export class ChargesTabComponent implements OnInit {
|
||||
const waiveChargeDialogRef = this.dialog.open(WaiveChargeDialogComponent, { data: { id: chargeId } });
|
||||
waiveChargeDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.confirm) {
|
||||
this.savingsService.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'waive', {}, chargeId)
|
||||
this.savingsService
|
||||
.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'waive', {}, chargeId)
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
@@ -167,7 +171,8 @@ export class ChargesTabComponent implements OnInit {
|
||||
const inactivateChargeDialogRef = this.dialog.open(InactivateChargeDialogComponent, { data: { id: chargeId } });
|
||||
inactivateChargeDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.confirm) {
|
||||
this.savingsService.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'inactivate', {}, chargeId)
|
||||
this.savingsService
|
||||
.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'inactivate', {}, chargeId)
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
@@ -188,6 +193,7 @@ export class ChargesTabComponent implements OnInit {
|
||||
type: 'number',
|
||||
required: true
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: `Edit Charge ${charge.id}`,
|
||||
@@ -204,7 +210,8 @@ export class ChargesTabComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.savingsService.editSavingsAccountCharge(this.fixedDepositsAccountData.id, dataObject, charge.id)
|
||||
this.savingsService
|
||||
.editSavingsAccountCharge(this.fixedDepositsAccountData.id, dataObject, charge.id)
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
@@ -222,10 +229,9 @@ export class ChargesTabComponent implements OnInit {
|
||||
});
|
||||
deleteChargeDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
this.savingsService.deleteSavingsAccountCharge(this.fixedDepositsAccountData.id, chargeId)
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
this.savingsService.deleteSavingsAccountCharge(this.fixedDepositsAccountData.id, chargeId).subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -235,7 +241,11 @@ export class ChargesTabComponent implements OnInit {
|
||||
* @param {any} charge Charge
|
||||
*/
|
||||
isRecurringCharge(charge: any) {
|
||||
return charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee' || charge.chargeTimeType.value === 'Weekly Fee';
|
||||
return (
|
||||
charge.chargeTimeType.value === 'Monthly Fee' ||
|
||||
charge.chargeTimeType.value === 'Annual Fee' ||
|
||||
charge.chargeTimeType.value === 'Weekly Fee'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,8 +263,8 @@ export class ChargesTabComponent implements OnInit {
|
||||
private reload() {
|
||||
const clientId = this.fixedDepositsAccountData.clientId;
|
||||
const url: string = this.router.url;
|
||||
this.router.navigateByUrl(`/clients/${clientId}/fixed-deposits-accounts`, {skipLocationChange: true})
|
||||
this.router
|
||||
.navigateByUrl(`/clients/${clientId}/fixed-deposits-accounts`, { skipLocationChange: true })
|
||||
.then(() => this.router.navigate([url]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('CalculateInterestDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CalculateInterestDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CalculateInterestDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+1
-3
@@ -11,10 +11,8 @@ import { MatDialogRef } from '@angular/material/dialog';
|
||||
styleUrls: ['./calculate-interest-dialog.component.scss']
|
||||
})
|
||||
export class CalculateInterestDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<CalculateInterestDialogComponent>) { }
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<CalculateInterestDialogComponent>) {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('InactivateChargeDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ InactivateChargeDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [InactivateChargeDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+4
-4
@@ -11,11 +11,11 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
styleUrls: ['./inactivate-charge-dialog.component.scss']
|
||||
})
|
||||
export class InactivateChargeDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<InactivateChargeDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<InactivateChargeDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('PostInterestDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PostInterestDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [PostInterestDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+1
-3
@@ -11,10 +11,8 @@ import { MatDialogRef } from '@angular/material/dialog';
|
||||
styleUrls: ['./post-interest-dialog.component.scss']
|
||||
})
|
||||
export class PostInterestDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<PostInterestDialogComponent>) { }
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<PostInterestDialogComponent>) {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ToggleWithholdTaxDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ToggleWithholdTaxDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ToggleWithholdTaxDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+4
-4
@@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
styleUrls: ['./toggle-withhold-tax-dialog.component.scss']
|
||||
})
|
||||
export class ToggleWithholdTaxDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
* @param {any} data.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<ToggleWithholdTaxDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ToggleWithholdTaxDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('WaiveChargeDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ WaiveChargeDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [WaiveChargeDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+4
-4
@@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
styleUrls: ['./waive-charge-dialog.component.scss']
|
||||
})
|
||||
export class WaiveChargeDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
* @param {any} data.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<WaiveChargeDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) { }
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<WaiveChargeDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('DatatableTabsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DatatableTabsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [DatatableTabsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
-1
@@ -29,5 +29,4 @@ export class DatatableTabsComponent {
|
||||
this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('FixedDepositAccountViewComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FixedDepositAccountViewComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [FixedDepositAccountViewComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+29
-19
@@ -26,7 +26,6 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./fixed-deposit-account-view.component.scss']
|
||||
})
|
||||
export class FixedDepositAccountViewComponent implements OnInit {
|
||||
|
||||
/** Fixed Deposits Account Data */
|
||||
fixedDepositsAccountData: any;
|
||||
/** Savings Data Tables */
|
||||
@@ -46,17 +45,19 @@ export class FixedDepositAccountViewComponent implements OnInit {
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private savingsService: SavingsService,
|
||||
public dialog: MatDialog) {
|
||||
this.route.data.subscribe((data: { fixedDepositsAccountData: any, savingsDatatables: any }) => {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private savingsService: SavingsService,
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.data.subscribe((data: { fixedDepositsAccountData: any; savingsDatatables: any }) => {
|
||||
this.fixedDepositsAccountData = data.fixedDepositsAccountData;
|
||||
this.savingsDatatables = data.savingsDatatables;
|
||||
this.currency = this.fixedDepositsAccountData.currency;
|
||||
const status: any = data.fixedDepositsAccountData.status;
|
||||
this.showTransactions = (status.id >= 300);
|
||||
this.showTransactions = status.id >= 300;
|
||||
});
|
||||
if (this.router.url.includes('clients')) {
|
||||
this.entityType = 'Client';
|
||||
@@ -97,7 +98,8 @@ export class FixedDepositAccountViewComponent implements OnInit {
|
||||
reload() {
|
||||
const clientId = this.fixedDepositsAccountData.clientId;
|
||||
const url: string = this.router.url;
|
||||
this.router.navigateByUrl(`/clients/${clientId}/fixed-deposits-accounts`, {skipLocationChange: true})
|
||||
this.router
|
||||
.navigateByUrl(`/clients/${clientId}/fixed-deposits-accounts`, { skipLocationChange: true })
|
||||
.then(() => this.router.navigate([url]));
|
||||
}
|
||||
|
||||
@@ -162,9 +164,11 @@ export class FixedDepositAccountViewComponent implements OnInit {
|
||||
const calculateInterestAccountDialogRef = this.dialog.open(CalculateInterestDialogComponent);
|
||||
calculateInterestAccountDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.confirm) {
|
||||
this.fixedDepositsService.executeFixedDepositsAccountCommand(this.fixedDepositsAccountData.id, 'calculateInterest', {}).subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
this.fixedDepositsService
|
||||
.executeFixedDepositsAccountCommand(this.fixedDepositsAccountData.id, 'calculateInterest', {})
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -176,14 +180,15 @@ export class FixedDepositAccountViewComponent implements OnInit {
|
||||
const postInterestAccountDialogRef = this.dialog.open(PostInterestDialogComponent);
|
||||
postInterestAccountDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.confirm) {
|
||||
this.fixedDepositsService.executeFixedDepositsAccountCommand(this.fixedDepositsAccountData.id, 'postInterest', {}).subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
this.fixedDepositsService
|
||||
.executeFixedDepositsAccountCommand(this.fixedDepositsAccountData.id, 'postInterest', {})
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enables withhold tax for fixed deposits account.
|
||||
* Fixed deposits endpoint is not supported so using Savings endpoint.
|
||||
@@ -194,7 +199,10 @@ export class FixedDepositAccountViewComponent implements OnInit {
|
||||
});
|
||||
deleteSavingsAccountDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.confirm) {
|
||||
this.savingsService.executeSavingsAccountUpdateCommand(this.fixedDepositsAccountData.id, 'updateWithHoldTax', { withHoldTax: true})
|
||||
this.savingsService
|
||||
.executeSavingsAccountUpdateCommand(this.fixedDepositsAccountData.id, 'updateWithHoldTax', {
|
||||
withHoldTax: true
|
||||
})
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
@@ -212,12 +220,14 @@ export class FixedDepositAccountViewComponent implements OnInit {
|
||||
});
|
||||
disableWithHoldTaxDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.confirm) {
|
||||
this.savingsService.executeSavingsAccountUpdateCommand(this.fixedDepositsAccountData.id, 'updateWithHoldTax', { withHoldTax: false})
|
||||
this.savingsService
|
||||
.executeSavingsAccountUpdateCommand(this.fixedDepositsAccountData.id, 'updateWithHoldTax', {
|
||||
withHoldTax: false
|
||||
})
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,13 +1,12 @@
|
||||
/** Fixed Deposits Account Buttons Configuration */
|
||||
export class FixedDepositsButtonsConfiguration {
|
||||
|
||||
optionArray: {
|
||||
name: string
|
||||
name: string;
|
||||
}[];
|
||||
|
||||
buttonsArray: {
|
||||
name: string,
|
||||
icon: string,
|
||||
name: string;
|
||||
icon: string;
|
||||
}[];
|
||||
|
||||
constructor(status: string) {
|
||||
@@ -52,7 +51,7 @@ export class FixedDepositsButtonsConfiguration {
|
||||
icon: 'fa fa-table'
|
||||
}
|
||||
];
|
||||
break;
|
||||
break;
|
||||
case 'Submitted and pending approval':
|
||||
this.buttonsArray = [
|
||||
{
|
||||
@@ -76,7 +75,7 @@ export class FixedDepositsButtonsConfiguration {
|
||||
icon: 'fa fa-check'
|
||||
}
|
||||
];
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
this.buttonsArray = [];
|
||||
}
|
||||
@@ -117,8 +116,7 @@ export class FixedDepositsButtonsConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
addOption(option: {name: string}) {
|
||||
addOption(option: { name: string }) {
|
||||
this.optionArray.push(option);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ GeneralTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [GeneralTabComponent]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(GeneralTabComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+4
-4
@@ -8,13 +8,14 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./general-tab.component.scss']
|
||||
})
|
||||
export class GeneralTabComponent {
|
||||
|
||||
fixedDepositsAccountData: any;
|
||||
entityType: string;
|
||||
currency: Currency;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => {
|
||||
this.fixedDepositsAccountData = data.fixedDepositsAccountData;
|
||||
this.currency = this.fixedDepositsAccountData.currency;
|
||||
@@ -27,5 +28,4 @@ export class GeneralTabComponent {
|
||||
this.entityType = 'Center';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('InterestRateChartTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ InterestRateChartTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [InterestRateChartTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+17
-6
@@ -14,20 +14,32 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
|
||||
trigger('expandChartSlab', [
|
||||
state('collapsed', style({ height: '0px', minHeight: '0' })),
|
||||
state('expanded', style({ height: '*' })),
|
||||
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))
|
||||
])
|
||||
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))])
|
||||
|
||||
]
|
||||
})
|
||||
export class InterestRateChartTabComponent {
|
||||
|
||||
/** Fixed Deposits Account Status */
|
||||
status: any;
|
||||
/** Interest Rate Chart Data */
|
||||
interestRateChartData: any = [];
|
||||
/** Columns to be displayed in interest rate chart table. */
|
||||
chartSlabsDisplayedColumns: any[] = ['period', 'amountRange', 'interest', 'description', 'actions'];
|
||||
chartSlabsDisplayedColumns: any[] = [
|
||||
'period',
|
||||
'amountRange',
|
||||
'interest',
|
||||
'description',
|
||||
'actions'
|
||||
];
|
||||
/** Columns to be displayed in incentives sub-table. */
|
||||
incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount'];
|
||||
incentivesDisplayedColumns: string[] = [
|
||||
'entityType',
|
||||
'attributeName',
|
||||
'conditionType',
|
||||
'attributeValue',
|
||||
'incentiveType',
|
||||
'amount'
|
||||
];
|
||||
/** Additional Column to display in incentives table */
|
||||
chartSlabsIncentivesDisplayedColumns: string[] = ['incentives'];
|
||||
/** Expand Chart Slab Index used in the view */
|
||||
@@ -42,5 +54,4 @@ export class InterestRateChartTabComponent {
|
||||
this.interestRateChartData = data.fixedDepositsAccountData.accountChart.chartSlabs;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('StandingInstructionsTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ StandingInstructionsTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [StandingInstructionsTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+15
-14
@@ -21,7 +21,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
|
||||
styleUrls: ['./standing-instructions-tab.component.scss']
|
||||
})
|
||||
export class StandingInstructionsTabComponent implements OnInit {
|
||||
|
||||
/** Fixed Deposits Data */
|
||||
fixedDepositsData: any;
|
||||
/** Instructions Data */
|
||||
@@ -50,11 +49,13 @@ export class StandingInstructionsTabComponent implements OnInit {
|
||||
* @param {AccountTransfersService} accountTransfersService Accounts Transfer Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dialog: MatDialog,
|
||||
private accountTransfersService: AccountTransfersService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dialog: MatDialog,
|
||||
private accountTransfersService: AccountTransfersService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => {
|
||||
this.fixedDepositsData = data.fixedDepositsAccountData;
|
||||
});
|
||||
@@ -73,11 +74,13 @@ export class StandingInstructionsTabComponent implements OnInit {
|
||||
const accountId = this.fixedDepositsData.id;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.fixedDepositsService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => {
|
||||
this.instructionsData = response.pageItems;
|
||||
this.dataSource.data = this.instructionsData;
|
||||
this.instructionTableRef.renderRows();
|
||||
});
|
||||
this.fixedDepositsService
|
||||
.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat)
|
||||
.subscribe((response: any) => {
|
||||
this.instructionsData = response.pageItems;
|
||||
this.dataSource.data = this.instructionsData;
|
||||
this.instructionTableRef.renderRows();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,10 +93,8 @@ export class StandingInstructionsTabComponent implements OnInit {
|
||||
});
|
||||
deleteStandingInstructionDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
this.accountTransfersService.deleteStandingInstrucions(instructionId)
|
||||
.subscribe(() => { });
|
||||
this.accountTransfersService.deleteStandingInstrucions(instructionId).subscribe(() => {});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('TransactionsTabComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ TransactionsTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [TransactionsTabComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+33
-12
@@ -25,7 +25,16 @@ export class TransactionsTabComponent implements OnInit {
|
||||
hideAccrualsParam: UntypedFormControl;
|
||||
hideReversedParam: UntypedFormControl;
|
||||
/** Columns to be displayed in transactions table. */
|
||||
displayedColumns: string[] = ['row', 'id', 'transactionDate', 'transactionType', 'debit', 'credit', 'balance', 'actions'];
|
||||
displayedColumns: string[] = [
|
||||
'row',
|
||||
'id',
|
||||
'transactionDate',
|
||||
'transactionType',
|
||||
'debit',
|
||||
'credit',
|
||||
'balance',
|
||||
'actions'
|
||||
];
|
||||
/** Data source for transactions table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
@@ -36,9 +45,11 @@ export class TransactionsTabComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
public dialog: MatDialog) {
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => {
|
||||
this.transactionsData = data.fixedDepositsAccountData.transactions;
|
||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||
@@ -56,8 +67,14 @@ export class TransactionsTabComponent implements OnInit {
|
||||
* Checks transaction status.
|
||||
*/
|
||||
checkStatus() {
|
||||
if (this.status === 'Active' || this.status === 'Closed' || this.status === 'Transfer in progress' ||
|
||||
this.status === 'Transfer on hold' || this.status === 'Premature Closed' || this.status === 'Matured') {
|
||||
if (
|
||||
this.status === 'Active' ||
|
||||
this.status === 'Closed' ||
|
||||
this.status === 'Transfer in progress' ||
|
||||
this.status === 'Transfer on hold' ||
|
||||
this.status === 'Premature Closed' ||
|
||||
this.status === 'Matured'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -68,8 +85,12 @@ export class TransactionsTabComponent implements OnInit {
|
||||
* @param {any} transactionType Transaction Type
|
||||
*/
|
||||
isDebit(transactionType: any) {
|
||||
return transactionType.withdrawal === true || transactionType.feeDeduction === true
|
||||
|| transactionType.overdraftInterest === true || transactionType.withholdTax === true;
|
||||
return (
|
||||
transactionType.withdrawal === true ||
|
||||
transactionType.feeDeduction === true ||
|
||||
transactionType.overdraftInterest === true ||
|
||||
transactionType.withholdTax === true
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +99,9 @@ export class TransactionsTabComponent implements OnInit {
|
||||
*/
|
||||
showTransactions(transactionsData: any) {
|
||||
if (transactionsData.transfer) {
|
||||
this.router.navigate([`account-transfers/account-transfers/${transactionsData.transfer.id}`], { relativeTo: this.route });
|
||||
this.router.navigate([`account-transfers/account-transfers/${transactionsData.transfer.id}`], {
|
||||
relativeTo: this.route
|
||||
});
|
||||
} else {
|
||||
this.router.navigate([transactionsData.id], { relativeTo: this.route });
|
||||
}
|
||||
@@ -97,7 +120,7 @@ export class TransactionsTabComponent implements OnInit {
|
||||
|
||||
if (hideAccrual || hideReversed) {
|
||||
transactions = this.transactionsData.filter((t: SavingsAccountTransaction) => {
|
||||
return (!(hideReversed && t.reversed) && !(hideAccrual && t.transactionType.accrual));
|
||||
return !(hideReversed && t.reversed) && !(hideAccrual && t.transactionType.accrual);
|
||||
});
|
||||
}
|
||||
this.dataSource = new MatTableDataSource(transactions);
|
||||
@@ -125,7 +148,5 @@ export class TransactionsTabComponent implements OnInit {
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
undoTransaction(transactionData: SavingsAccountTransaction): void {
|
||||
|
||||
}
|
||||
undoTransaction(transactionData: SavingsAccountTransaction): void {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ViewTransactionComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewTransactionComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ViewTransactionComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+17
-11
@@ -23,12 +23,14 @@ export class ViewTransactionComponent {
|
||||
|
||||
/**
|
||||
*/
|
||||
constructor(private savingsService: SavingsService,
|
||||
private route: ActivatedRoute,
|
||||
private dateUtils: Dates,
|
||||
private router: Router,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private savingsService: SavingsService,
|
||||
private route: ActivatedRoute,
|
||||
private dateUtils: Dates,
|
||||
private router: Router,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { fixedDepositsAccountTransaction: any }) => {
|
||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||
this.transactionData = data.fixedDepositsAccountTransaction;
|
||||
@@ -53,16 +55,20 @@ export class ViewTransactionComponent {
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const data = {
|
||||
transactionDate: this.dateUtils.formatDate(this.transactionData.date && new Date(this.transactionData.date), dateFormat),
|
||||
transactionDate: this.dateUtils.formatDate(
|
||||
this.transactionData.date && new Date(this.transactionData.date),
|
||||
dateFormat
|
||||
),
|
||||
transactionAmount: 0,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, this.transactionData.id).subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
this.savingsService
|
||||
.executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, this.transactionData.id)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ActivateFixedDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ActivateFixedDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ActivateFixedDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+12
-9
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./activate-fixed-deposits-account.component.scss']
|
||||
})
|
||||
export class ActivateFixedDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -36,12 +35,14 @@ export class ActivateFixedDepositsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private savingsService: SavingsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private savingsService: SavingsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||
}
|
||||
|
||||
@@ -58,7 +59,10 @@ export class ActivateFixedDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createActivateFixedDepositsAccountForm() {
|
||||
this.activateFixedDepositsAccountForm = this.formBuilder.group({
|
||||
'activatedOnDate': ['', Validators.required]
|
||||
activatedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,5 +87,4 @@ export class ActivateFixedDepositsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('AddChargeFixedDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AddChargeFixedDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [AddChargeFixedDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+19
-12
@@ -18,7 +18,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./add-charge-fixed-deposits-account.component.scss']
|
||||
})
|
||||
export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum Due Date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum Due Date allowed. */
|
||||
@@ -65,7 +64,7 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
||||
}
|
||||
|
||||
buildDependencies() {
|
||||
this.fixedDepositsChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => {
|
||||
this.fixedDepositsChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => {
|
||||
this.savingsService.getChargeTemplate(chargeId).subscribe((data: any) => {
|
||||
this.chargeDetails = data;
|
||||
const chargeTimeType = data.chargeTimeType.id;
|
||||
@@ -86,14 +85,17 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
||||
this.fixedDepositsChargeForm.removeControl('feeOnMonthDay');
|
||||
}
|
||||
if (chargeTimeType.value === 'Monthly Fee') {
|
||||
this.fixedDepositsChargeForm.addControl('feeInterval', new UntypedFormControl(data.feeInterval, Validators.required));
|
||||
this.fixedDepositsChargeForm.addControl(
|
||||
'feeInterval',
|
||||
new UntypedFormControl(data.feeInterval, Validators.required)
|
||||
);
|
||||
} else {
|
||||
this.fixedDepositsChargeForm.removeControl('feeInterval');
|
||||
}
|
||||
this.fixedDepositsChargeForm.patchValue({
|
||||
'amount': data.amount,
|
||||
'chargeCalculationType': data.chargeCalculationType.id,
|
||||
'chargeTimeType': data.chargeTimeType.id
|
||||
amount: data.amount,
|
||||
chargeCalculationType: data.chargeCalculationType.id,
|
||||
chargeTimeType: data.chargeTimeType.id
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -104,10 +106,16 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createFixedDepositsChargeForm() {
|
||||
this.fixedDepositsChargeForm = this.formBuilder.group({
|
||||
'chargeId': ['', Validators.required],
|
||||
'amount': ['', Validators.required],
|
||||
'chargeCalculationType': [{ value: '', disabled: true }],
|
||||
'chargeTimeType': [{ value: '', disabled: true }]
|
||||
chargeId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
amount: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
chargeCalculationType: [{ value: '', disabled: true }],
|
||||
chargeTimeType: [{ value: '', disabled: true }]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -137,9 +145,8 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.savingsService.createSavingsCharge(this.fixedDepositAccountId, 'charges', savingsCharge).subscribe( () => {
|
||||
this.savingsService.createSavingsCharge(this.fixedDepositAccountId, 'charges', savingsCharge).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ApproveFixedDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApproveFixedDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ApproveFixedDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+13
-10
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./approve-fixed-deposits-account.component.scss']
|
||||
})
|
||||
export class ApproveFixedDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class ApproveFixedDepositsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class ApproveFixedDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createApproveFixedDepositsAccountForm() {
|
||||
this.approveFixedDepositsAccountForm = this.formBuilder.group({
|
||||
'approvedOnDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
approvedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,5 +87,4 @@ export class ApproveFixedDepositsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('CloseFixedDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CloseFixedDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CloseFixedDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+22
-13
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./close-fixed-deposits-account.component.scss']
|
||||
})
|
||||
export class CloseFixedDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -42,12 +41,14 @@ export class CloseFixedDepositsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { fixedDepositsAccountActionData: any }) => {
|
||||
this.savingsAccountsData = data.fixedDepositsAccountActionData.savingsAccounts;
|
||||
this.onAccountClosureOptions = data.fixedDepositsAccountActionData.onAccountClosureOptions;
|
||||
@@ -70,10 +71,16 @@ export class CloseFixedDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createCloseOnMaturityAccountForm() {
|
||||
this.closeOnMaturityAccountForm = this.formBuilder.group({
|
||||
'closedOnDate': ['', Validators.required],
|
||||
'maturityAmount': [{value: this.maturityAmount, disabled: true}],
|
||||
'onAccountClosureId': ['', Validators.required],
|
||||
'note': ['']
|
||||
closedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
maturityAmount: [{ value: this.maturityAmount, disabled: true }],
|
||||
onAccountClosureId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,7 +90,10 @@ export class CloseFixedDepositsAccountComponent implements OnInit {
|
||||
addTransferDetails() {
|
||||
this.closeOnMaturityAccountForm.get('onAccountClosureId').valueChanges.subscribe((id: any) => {
|
||||
if (id === 200) {
|
||||
this.closeOnMaturityAccountForm.addControl('toSavingsAccountId', new UntypedFormControl('', Validators.required));
|
||||
this.closeOnMaturityAccountForm.addControl(
|
||||
'toSavingsAccountId',
|
||||
new UntypedFormControl('', Validators.required)
|
||||
);
|
||||
this.closeOnMaturityAccountForm.addControl('transferDescription', new UntypedFormControl(''));
|
||||
} else {
|
||||
this.closeOnMaturityAccountForm.removeControl('toSavingsAccountId');
|
||||
@@ -113,5 +123,4 @@ export class CloseFixedDepositsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('FixedDepositsAccountActionsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FixedDepositsAccountActionsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [FixedDepositsAccountActionsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+15
-17
@@ -11,30 +11,29 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./fixed-deposits-account-actions.component.scss']
|
||||
})
|
||||
export class FixedDepositsAccountActionsComponent {
|
||||
|
||||
/** Flag object to store possible actions and render appropriate UI to the user */
|
||||
actions: {
|
||||
'Approve': boolean
|
||||
'Reject': boolean
|
||||
'Activate': boolean
|
||||
'Close': boolean
|
||||
'Undo Approval': boolean
|
||||
'Undo Activation': boolean
|
||||
'Add Charge': boolean
|
||||
'Premature Close': boolean
|
||||
'Withdrawn by Client': boolean
|
||||
'Withdrawal': boolean
|
||||
Approve: boolean;
|
||||
Reject: boolean;
|
||||
Activate: boolean;
|
||||
Close: boolean;
|
||||
'Undo Approval': boolean;
|
||||
'Undo Activation': boolean;
|
||||
'Add Charge': boolean;
|
||||
'Premature Close': boolean;
|
||||
'Withdrawn by Client': boolean;
|
||||
Withdrawal: boolean;
|
||||
} = {
|
||||
'Approve': false,
|
||||
'Reject': false,
|
||||
'Activate': false,
|
||||
'Close': false,
|
||||
Approve: false,
|
||||
Reject: false,
|
||||
Activate: false,
|
||||
Close: false,
|
||||
'Undo Approval': false,
|
||||
'Undo Activation': false,
|
||||
'Add Charge': false,
|
||||
'Premature Close': false,
|
||||
'Withdrawn by Client': false,
|
||||
'Withdrawal': false
|
||||
Withdrawal: false
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -44,5 +43,4 @@ export class FixedDepositsAccountActionsComponent {
|
||||
const name = this.route.snapshot.params['name'];
|
||||
this.actions[name] = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('FixedDepositsCashTransactionComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ FixedDepositsCashTransactionComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [FixedDepositsCashTransactionComponent]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(FixedDepositsCashTransactionComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+24
-16
@@ -12,7 +12,6 @@ import { Currency, PaymentType } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./fixed-deposits-cash-transaction.component.scss']
|
||||
})
|
||||
export class FixedDepositsCashTransactionComponent implements OnInit {
|
||||
|
||||
/** Minimum Due Date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum Due Date allowed. */
|
||||
@@ -24,7 +23,7 @@ export class FixedDepositsCashTransactionComponent implements OnInit {
|
||||
/** Flag to enable payment details fields. */
|
||||
addPaymentDetailsFlag: Boolean = false;
|
||||
/** transaction type flag to render required UI */
|
||||
transactionType: { deposit: boolean, withdrawal: boolean } = { deposit: false, withdrawal: false };
|
||||
transactionType: { deposit: boolean; withdrawal: boolean } = { deposit: false, withdrawal: false };
|
||||
/** transaction command for submit request */
|
||||
transactionCommand: string;
|
||||
actionName: string;
|
||||
@@ -41,12 +40,14 @@ export class FixedDepositsCashTransactionComponent implements OnInit {
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { fixedDepositsAccountActionData: any }) => {
|
||||
this.currency = data.fixedDepositsAccountActionData.currency;
|
||||
this.paymentTypeOptions = data.fixedDepositsAccountActionData.paymentTypeOptions;
|
||||
@@ -70,10 +71,16 @@ export class FixedDepositsCashTransactionComponent implements OnInit {
|
||||
*/
|
||||
createSavingAccountTransactionForm() {
|
||||
this.accountTransactionForm = this.formBuilder.group({
|
||||
'transactionDate': [this.settingsService.businessDate, Validators.required],
|
||||
'transactionAmount': [0, Validators.required],
|
||||
'paymentTypeId': [''],
|
||||
'note': ['']
|
||||
transactionDate: [
|
||||
this.settingsService.businessDate,
|
||||
Validators.required
|
||||
],
|
||||
transactionAmount: [
|
||||
0,
|
||||
Validators.required
|
||||
],
|
||||
paymentTypeId: [''],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -115,9 +122,10 @@ export class FixedDepositsCashTransactionComponent implements OnInit {
|
||||
};
|
||||
delete data.note;
|
||||
data['transactionAmount'] = data['transactionAmount'] * 1;
|
||||
this.fixedDepositsService.executeFixedDepositsAccountTransactionsCommand(this.accountId, this.transactionCommand, data).subscribe(res => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
this.fixedDepositsService
|
||||
.executeFixedDepositsAccountTransactionsCommand(this.accountId, this.transactionCommand, data)
|
||||
.subscribe((res) => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('PrematureCloseFixedDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PrematureCloseFixedDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [PrematureCloseFixedDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+27
-14
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./premature-close-fixed-deposits-account.component.scss']
|
||||
})
|
||||
export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -33,7 +32,6 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
/** Form submission event */
|
||||
isSubmitted = false;
|
||||
|
||||
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||
@@ -42,12 +40,14 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||
}
|
||||
|
||||
@@ -65,7 +65,10 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createPrematureCloseAccountForm() {
|
||||
this.prematureCloseAccountForm = this.formBuilder.group({
|
||||
'closedOnDate': ['', Validators.required]
|
||||
closedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -92,17 +95,23 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, 'calculatePrematureAmount', data)
|
||||
this.fixedDepositsService
|
||||
.executeFixedDepositsAccountCommand(this.accountId, 'calculatePrematureAmount', data)
|
||||
.subscribe((response: any) => {
|
||||
this.savingsAccountsData = response.savingsAccounts;
|
||||
this.onAccountClosureOptions = response.onAccountClosureOptions;
|
||||
this.prematureCloseAccountForm.addControl('maturityAmount', new UntypedFormControl({ value: '', disabled: true }));
|
||||
this.prematureCloseAccountForm.addControl('onAccountClosureId', new UntypedFormControl('', Validators.required));
|
||||
this.prematureCloseAccountForm.addControl(
|
||||
'maturityAmount',
|
||||
new UntypedFormControl({ value: '', disabled: true })
|
||||
);
|
||||
this.prematureCloseAccountForm.addControl(
|
||||
'onAccountClosureId',
|
||||
new UntypedFormControl('', Validators.required)
|
||||
);
|
||||
this.prematureCloseAccountForm.addControl('note', new UntypedFormControl(''));
|
||||
this.prematureCloseAccountForm.get('maturityAmount').patchValue(response.maturityAmount);
|
||||
this.addTransferDetails();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,7 +120,10 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
addTransferDetails() {
|
||||
this.prematureCloseAccountForm.get('onAccountClosureId').valueChanges.subscribe((id: any) => {
|
||||
if (id === 200) {
|
||||
this.prematureCloseAccountForm.addControl('toSavingsAccountId', new UntypedFormControl('', Validators.required));
|
||||
this.prematureCloseAccountForm.addControl(
|
||||
'toSavingsAccountId',
|
||||
new UntypedFormControl('', Validators.required)
|
||||
);
|
||||
this.prematureCloseAccountForm.addControl('transferDescription', new UntypedFormControl(''));
|
||||
} else {
|
||||
this.prematureCloseAccountForm.removeControl('toSavingsAccountId');
|
||||
@@ -138,9 +150,10 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, 'prematureClose', data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.fixedDepositsService
|
||||
.executeFixedDepositsAccountCommand(this.accountId, 'prematureClose', data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('RejectFixedDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RejectFixedDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RejectFixedDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+13
-10
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./reject-fixed-deposits-account.component.scss']
|
||||
})
|
||||
export class RejectFixedDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class RejectFixedDepositsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class RejectFixedDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createRejectFixedDepositsAccountForm() {
|
||||
this.rejectFixedDepositsAccountForm = this.formBuilder.group({
|
||||
'rejectedOnDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
rejectedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,5 +87,4 @@ export class RejectFixedDepositsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('UndoApprovalFixedDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UndoApprovalFixedDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [UndoApprovalFixedDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+14
-12
@@ -16,7 +16,6 @@ import { FixedDepositsService } from '../../fixed-deposits.service';
|
||||
styleUrls: ['./undo-approval-fixed-deposits-account.component.scss']
|
||||
})
|
||||
export class UndoApprovalFixedDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Undo Approval Fixed Deposits Account form. */
|
||||
undoApprovalFixedDepositsAccountForm: UntypedFormGroup;
|
||||
/** Fixed Deposits Account Id */
|
||||
@@ -32,11 +31,13 @@ export class UndoApprovalFixedDepositsAccountComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private savingsService: SavingsService,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private savingsService: SavingsService,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
this.undoCommand = 'undoapproval'; // Default command
|
||||
this.undoAction = this.route.snapshot.params['name'];
|
||||
if (this.undoAction === 'Undo Activation') {
|
||||
@@ -57,7 +58,7 @@ export class UndoApprovalFixedDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createUndoApprovalFixedDepositsAccountForm() {
|
||||
this.undoApprovalFixedDepositsAccountForm = this.formBuilder.group({
|
||||
'note': ['']
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -67,17 +68,18 @@ export class UndoApprovalFixedDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
submit() {
|
||||
const data = {
|
||||
...this.undoApprovalFixedDepositsAccountForm.value,
|
||||
...this.undoApprovalFixedDepositsAccountForm.value
|
||||
};
|
||||
if (this.undoAction === 'Undo Activation') {
|
||||
this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, this.undoCommand, data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.fixedDepositsService
|
||||
.executeFixedDepositsAccountCommand(this.accountId, this.undoCommand, data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
} else {
|
||||
this.savingsService.executeSavingsAccountCommand(this.accountId, this.undoCommand, data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('WithdrawByClientFixedDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ WithdrawByClientFixedDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [WithdrawByClientFixedDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+18
-13
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./withdraw-by-client-fixed-deposits-account.component.scss']
|
||||
})
|
||||
export class WithdrawByClientFixedDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private fixedDepositsService: FixedDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createWithdrawFixedDepositsAccountForm() {
|
||||
this.withdrawFixedDepositsAccountForm = this.formBuilder.group({
|
||||
'withdrawnOnDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
withdrawnOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -79,9 +83,10 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, 'withdrawnByApplicant', data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.fixedDepositsService
|
||||
.executeFixedDepositsAccountCommand(this.accountId, 'withdrawnByApplicant', data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ const routes: Routes = [
|
||||
path: ':fixedDepositAccountId',
|
||||
data: { title: 'Fixed Deposit Account View', routeParamBreadcrumb: 'fixedDepositAccountId' },
|
||||
resolve: {
|
||||
fixedDepositsAccountData: FixedDepositsAccountViewResolver,
|
||||
fixedDepositsAccountData: FixedDepositsAccountViewResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -60,17 +60,25 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'general',
|
||||
component: GeneralTabComponent,
|
||||
data: { title: 'Fixed Deposit Account Details', breadcrumb: 'General', routeParamBreadcrumb: false },
|
||||
data: { title: 'Fixed Deposit Account Details', breadcrumb: 'General', routeParamBreadcrumb: false }
|
||||
},
|
||||
{
|
||||
path: 'interest-rate-chart',
|
||||
component: InterestRateChartTabComponent,
|
||||
data: { title: 'Fixed Deposit Account Interest Rate Chart', breadcrumb: 'Interest Rate Chart', routeParamBreadcrumb: false },
|
||||
data: {
|
||||
title: 'Fixed Deposit Account Interest Rate Chart',
|
||||
breadcrumb: 'Interest Rate Chart',
|
||||
routeParamBreadcrumb: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'transactions',
|
||||
component: TransactionsTabComponent,
|
||||
data: { title: 'Fixed Deposit Account Transactions', breadcrumb: 'Transactions', routeParamBreadcrumb: false },
|
||||
data: {
|
||||
title: 'Fixed Deposit Account Transactions',
|
||||
breadcrumb: 'Transactions',
|
||||
routeParamBreadcrumb: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'charges',
|
||||
@@ -80,7 +88,11 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'standing-instructions',
|
||||
component: StandingInstructionsTabComponent,
|
||||
data: { title: 'Fixed Deposit Account Standing Instructions', breadcrumb: 'Standing Instructions', routeParamBreadcrumb: false }
|
||||
data: {
|
||||
title: 'Fixed Deposit Account Standing Instructions',
|
||||
breadcrumb: 'Standing Instructions',
|
||||
routeParamBreadcrumb: false
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'datatables',
|
||||
@@ -107,15 +119,21 @@ const routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'transactions',
|
||||
data: { title: 'Fixed Deposits Account Transactions', breadcrumb: 'Transactions', routeParamBreadcrumb: false },
|
||||
data: {
|
||||
title: 'Fixed Deposits Account Transactions',
|
||||
breadcrumb: 'Transactions',
|
||||
routeParamBreadcrumb: false
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
redirectTo: '../transactions', pathMatch: 'prefix'
|
||||
redirectTo: '../transactions',
|
||||
pathMatch: 'prefix'
|
||||
},
|
||||
{
|
||||
path: 'account-transfers',
|
||||
loadChildren: () => import('../../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule)
|
||||
loadChildren: () =>
|
||||
import('../../account-transfers/account-transfers.module').then((m) => m.AccountTransfersModule)
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
@@ -159,4 +177,4 @@ const routes: Routes = [
|
||||
FixedDepositsAccountAndTemplateResolver
|
||||
]
|
||||
})
|
||||
export class FixedDepositsRoutingModule { }
|
||||
export class FixedDepositsRoutingModule {}
|
||||
|
||||
@@ -85,6 +85,6 @@ import { FixedDepositsCashTransactionComponent } from './fixed-deposits-account-
|
||||
DirectivesModule,
|
||||
FixedDepositsRoutingModule
|
||||
],
|
||||
providers: [ ]
|
||||
providers: []
|
||||
})
|
||||
export class FixedDepositsModule { }
|
||||
export class FixedDepositsModule {}
|
||||
|
||||
@@ -12,7 +12,6 @@ import { Observable } from 'rxjs';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class FixedDepositsService {
|
||||
|
||||
/**
|
||||
* @param {HttpClient} http HttpClient
|
||||
*/
|
||||
@@ -62,9 +61,16 @@ export class FixedDepositsService {
|
||||
* @param {string} transactionId Transaction Id
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
executeFixedDepositsAccountTransactionsCommand(accountId: string, command: string, data: any, transactionId?: any): Observable<any> {
|
||||
executeFixedDepositsAccountTransactionsCommand(
|
||||
accountId: string,
|
||||
command: string,
|
||||
data: any,
|
||||
transactionId?: any
|
||||
): Observable<any> {
|
||||
const httpParams = new HttpParams().set('command', command);
|
||||
return this.http.post(`/fixeddepositaccounts/${accountId}/transactions/${transactionId}`, data, { params: httpParams });
|
||||
return this.http.post(`/fixeddepositaccounts/${accountId}/transactions/${transactionId}`, data, {
|
||||
params: httpParams
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,8 +105,7 @@ export class FixedDepositsService {
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getFixedDepositsAccountAndTemplate(accountId: any) {
|
||||
const httpParams = new HttpParams().set('associations', 'charges,+linkedAccount')
|
||||
.set('template', 'true');
|
||||
const httpParams = new HttpParams().set('associations', 'charges,+linkedAccount').set('template', 'true');
|
||||
return this.http.get(`/fixeddepositaccounts/${accountId}`, { params: httpParams });
|
||||
}
|
||||
|
||||
@@ -130,8 +135,12 @@ export class FixedDepositsService {
|
||||
* @returns {Observable<any>} Standing Instructions
|
||||
*/
|
||||
getStandingInstructions(
|
||||
clientId: string, clientName: string, fromAccountId: string,
|
||||
locale: string, dateFormat: string): Observable<any> {
|
||||
clientId: string,
|
||||
clientName: string,
|
||||
fromAccountId: string,
|
||||
locale: string,
|
||||
dateFormat: string
|
||||
): Observable<any> {
|
||||
const httpParams = new HttpParams()
|
||||
.set('clientId', clientId)
|
||||
.set('clientName', clientName)
|
||||
@@ -141,5 +150,4 @@ export class FixedDepositsService {
|
||||
.set('dateFormat', dateFormat);
|
||||
return this.http.get(`/standinginstructions`, { params: httpParams });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+14
-7
@@ -14,13 +14,14 @@ import { RecurringDepositsService } from '../recurring-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class RecurringDepositsAccountActionsResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SavingsService} SavingsService Savings service.
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service.
|
||||
*/
|
||||
constructor(private savingsService: SavingsService,
|
||||
private recurringDepositsService: RecurringDepositsService) { }
|
||||
constructor(
|
||||
private savingsService: SavingsService,
|
||||
private recurringDepositsService: RecurringDepositsService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Returns the Recurring deposits account actions data.
|
||||
@@ -29,18 +30,24 @@ export class RecurringDepositsAccountActionsResolver implements Resolve<Object>
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const actionName: string = route.paramMap.get('name');
|
||||
const recurringDepositAccountId = route.paramMap.get('recurringDepositAccountId') || route.parent.parent.paramMap.get('recurringDepositAccountId');
|
||||
const recurringDepositAccountId =
|
||||
route.paramMap.get('recurringDepositAccountId') || route.parent.parent.paramMap.get('recurringDepositAccountId');
|
||||
switch (actionName) {
|
||||
case 'Add Charge':
|
||||
return this.savingsService.getSavingsChargeTemplateResource(recurringDepositAccountId);
|
||||
case 'Close':
|
||||
return this.recurringDepositsService.getRecurringDepositAccountActionResource(recurringDepositAccountId, 'close');
|
||||
return this.recurringDepositsService.getRecurringDepositAccountActionResource(
|
||||
recurringDepositAccountId,
|
||||
'close'
|
||||
);
|
||||
case 'Deposit':
|
||||
case 'Withdrawal':
|
||||
return this.recurringDepositsService.getRecurringDepositAccountTransactionTemplateResource(recurringDepositAccountId, actionName.toLocaleLowerCase());
|
||||
return this.recurringDepositsService.getRecurringDepositAccountTransactionTemplateResource(
|
||||
recurringDepositAccountId,
|
||||
actionName.toLocaleLowerCase()
|
||||
);
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+13
-15
@@ -13,20 +13,18 @@ import { RecurringDepositsService } from '../recurring-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class RecurringDepositsAccountAndTemplateResolver implements Resolve<Object> {
|
||||
/**
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service.
|
||||
*/
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) {}
|
||||
|
||||
/**
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service.
|
||||
*/
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) { }
|
||||
|
||||
/**
|
||||
* Returns the Recurring Deposits Account Template.
|
||||
* @param {ActivatedRouteSnapshot} route Route Snapshot
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const recurringDepositAccountId = route.paramMap.get('recurringDepositAccountId');
|
||||
return this.recurringDepositsService.getRecurringDepositsAccountAndTemplate(recurringDepositAccountId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Recurring Deposits Account Template.
|
||||
* @param {ActivatedRouteSnapshot} route Route Snapshot
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const recurringDepositAccountId = route.paramMap.get('recurringDepositAccountId');
|
||||
return this.recurringDepositsService.getRecurringDepositsAccountAndTemplate(recurringDepositAccountId);
|
||||
}
|
||||
}
|
||||
|
||||
+17
-16
@@ -13,21 +13,22 @@ import { RecurringDepositsService } from '../recurring-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class RecurringDepositsAccountTransactionTemplateResolver implements Resolve<Object> {
|
||||
/**
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service.
|
||||
*/
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) {}
|
||||
|
||||
/**
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service.
|
||||
*/
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) { }
|
||||
|
||||
/**
|
||||
* Returns the Recurring Deposits Account Transaction data.
|
||||
* @param {ActivatedRouteSnapshot} route Route Snapshot
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId');
|
||||
const transactionId = route.paramMap.get('id');
|
||||
return this.recurringDepositsService.getRecurringDepositsAccountTransactionTemplate(recurringDepositAccountId, transactionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Recurring Deposits Account Transaction data.
|
||||
* @param {ActivatedRouteSnapshot} route Route Snapshot
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId');
|
||||
const transactionId = route.paramMap.get('id');
|
||||
return this.recurringDepositsService.getRecurringDepositsAccountTransactionTemplate(
|
||||
recurringDepositAccountId,
|
||||
transactionId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+17
-16
@@ -13,21 +13,22 @@ import { RecurringDepositsService } from '../recurring-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class RecurringDepositsAccountTransactionResolver implements Resolve<Object> {
|
||||
/**
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service.
|
||||
*/
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) {}
|
||||
|
||||
/**
|
||||
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service.
|
||||
*/
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) { }
|
||||
|
||||
/**
|
||||
* Returns the Recurring Deposits Account Transaction data.
|
||||
* @param {ActivatedRouteSnapshot} route Route Snapshot
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId');
|
||||
const transactionId = route.paramMap.get('id');
|
||||
return this.recurringDepositsService.getRecurringDepositsAccountTransaction(recurringDepositAccountId, transactionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Recurring Deposits Account Transaction data.
|
||||
* @param {ActivatedRouteSnapshot} route Route Snapshot
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId');
|
||||
const transactionId = route.paramMap.get('id');
|
||||
return this.recurringDepositsService.getRecurringDepositsAccountTransaction(
|
||||
recurringDepositAccountId,
|
||||
transactionId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-3
@@ -13,11 +13,10 @@ import { RecurringDepositsService } from '../recurring-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class RecurringDepositsAccountDataResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {RecurringDepositsService} RecurringDepositsService RecurringDeposits service.
|
||||
*/
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) { }
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) {}
|
||||
|
||||
/**
|
||||
* Returns the RecurringDeposits Account data.
|
||||
@@ -28,5 +27,4 @@ export class RecurringDepositsAccountDataResolver implements Resolve<Object> {
|
||||
const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId');
|
||||
return this.recurringDepositsService.getRecurringDepositsAccountData(recurringDepositAccountId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-3
@@ -13,11 +13,10 @@ import { RecurringDepositsService } from '../recurring-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class RecurringDepositsAccountTemplateResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {recurringDepositsService} RecurringDepositsService Savings service.
|
||||
*/
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) { }
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) {}
|
||||
|
||||
/**
|
||||
* Returns the Shares Account Template.
|
||||
@@ -28,5 +27,4 @@ export class RecurringDepositsAccountTemplateResolver implements Resolve<Object>
|
||||
const clientId = route.parent.parent.paramMap.get('clientId');
|
||||
return this.recurringDepositsService.getRecurringDepositsAccountTemplate(clientId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-3
@@ -13,11 +13,10 @@ import { RecurringDepositsService } from '../recurring-deposits.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class RecurringDepositsAccountViewResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {RecurringDepositsService} RecurringDepositsService RecurringDeposits service.
|
||||
*/
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) { }
|
||||
constructor(private recurringDepositsService: RecurringDepositsService) {}
|
||||
|
||||
/**
|
||||
* Returns the RecurringDeposits Account data.
|
||||
@@ -28,5 +27,4 @@ export class RecurringDepositsAccountViewResolver implements Resolve<Object> {
|
||||
const recurringDepositAccountId = route.paramMap.get('recurringDepositAccountId');
|
||||
return this.recurringDepositsService.getRecurringDepositsAccountData(recurringDepositAccountId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('CreateRecurringDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CreateRecurringDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CreateRecurringDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+27
-13
@@ -22,23 +22,27 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./create-recurring-deposits-account.component.scss']
|
||||
})
|
||||
export class CreateRecurringDepositsAccountComponent {
|
||||
|
||||
/** Imports all the step component */
|
||||
@ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true }) recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountTermsStepComponent, { static: true }) recurringDepositAccountTermsStep: RecurringDepositsAccountTermsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountSettingsStepComponent, { static: true }) recurringDepositAccountSettingsStep: RecurringDepositsAccountSettingsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountChargesStepComponent, { static: true }) recurringDepositAccountChargesStep: RecurringDepositsAccountChargesStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true })
|
||||
recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountTermsStepComponent, { static: true })
|
||||
recurringDepositAccountTermsStep: RecurringDepositsAccountTermsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountSettingsStepComponent, { static: true })
|
||||
recurringDepositAccountSettingsStep: RecurringDepositsAccountSettingsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountChargesStepComponent, { static: true })
|
||||
recurringDepositAccountChargesStep: RecurringDepositsAccountChargesStepComponent;
|
||||
|
||||
/** Recurring Deposits Account Template */
|
||||
recurringDepositsAccountTemplate: any;
|
||||
/** Recurring Deposit Account Product Template */
|
||||
recurringDepositsAccountProductTemplate: any;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private settingsService: SettingsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { recurringDepositsAccountTemplate: any }) => {
|
||||
this.recurringDepositsAccountTemplate = data.recurringDepositsAccountTemplate;
|
||||
@@ -83,18 +87,17 @@ export class CreateRecurringDepositsAccountComponent {
|
||||
...this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetails,
|
||||
...this.recurringDepositAccountTermsStep.recurringDepositAccountTerms,
|
||||
...this.recurringDepositAccountSettingsStep.recurringDepositAccountSettings,
|
||||
...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges,
|
||||
...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/** Retrieves Data of all forms except Currency to submit the data */
|
||||
get recurringDepositAccount() {
|
||||
return {
|
||||
...this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetails,
|
||||
...this.recurringDepositAccountTermsStep.recurringDepositAccountTerms,
|
||||
...this.recurringDepositAccountSettingsStep.recurringDepositAccountSettings,
|
||||
...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges,
|
||||
...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges
|
||||
};
|
||||
}
|
||||
|
||||
@@ -115,16 +118,27 @@ export class CreateRecurringDepositsAccountComponent {
|
||||
feeOnMonthDay: charge.feeOnMonthDay,
|
||||
feeInterval: charge.feeInterval
|
||||
})),
|
||||
isCalendarInherited: this.recurringDepositAccount.recurringDepositAccount ? this.recurringDepositAccount.recurringDepositAccount : false,
|
||||
isCalendarInherited: this.recurringDepositAccount.recurringDepositAccount
|
||||
? this.recurringDepositAccount.recurringDepositAccount
|
||||
: false,
|
||||
submittedOnDate: this.dateUtils.formatDate(this.recurringDepositAccount.submittedOnDate, dateFormat),
|
||||
expectedFirstDepositOnDate: this.dateUtils.formatDate(this.recurringDepositAccount.expectedFirstDepositOnDate, dateFormat),
|
||||
expectedFirstDepositOnDate: this.dateUtils.formatDate(
|
||||
this.recurringDepositAccount.expectedFirstDepositOnDate,
|
||||
dateFormat
|
||||
),
|
||||
dateFormat,
|
||||
monthDayFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
this.recurringDepositsService.createRecurringDepositAccount(recurringDepositAccount).subscribe((response: any) => {
|
||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||
this.router.navigate(
|
||||
[
|
||||
'../',
|
||||
response.resourceId
|
||||
],
|
||||
{ relativeTo: this.route }
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('EditRecurringDepositAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditRecurringDepositAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [EditRecurringDepositAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+27
-20
@@ -22,23 +22,27 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./edit-recurring-deposit-account.component.scss']
|
||||
})
|
||||
export class EditRecurringDepositAccountComponent {
|
||||
|
||||
/** Imports all the step component */
|
||||
@ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true }) recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountTermsStepComponent, { static: true }) recurringDepositAccountTermsStep: RecurringDepositsAccountTermsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountSettingsStepComponent, { static: true }) recurringDepositAccountSettingsStep: RecurringDepositsAccountSettingsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountChargesStepComponent, { static: true }) recurringDepositAccountChargesStep: RecurringDepositsAccountChargesStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true })
|
||||
recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountTermsStepComponent, { static: true })
|
||||
recurringDepositAccountTermsStep: RecurringDepositsAccountTermsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountSettingsStepComponent, { static: true })
|
||||
recurringDepositAccountSettingsStep: RecurringDepositsAccountSettingsStepComponent;
|
||||
@ViewChild(RecurringDepositsAccountChargesStepComponent, { static: true })
|
||||
recurringDepositAccountChargesStep: RecurringDepositsAccountChargesStepComponent;
|
||||
|
||||
/** Recurring Deposits Account And Template */
|
||||
recurringDepositsAccountAndTemplate: any;
|
||||
/** Recurring Deposit Account Product Template */
|
||||
recurringDepositsAccountProductTemplate: any;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private settingsService: SettingsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { recurringDepositsAccountAndTemplate: any }) => {
|
||||
this.recurringDepositsAccountAndTemplate = data.recurringDepositsAccountAndTemplate;
|
||||
@@ -74,12 +78,10 @@ export class EditRecurringDepositAccountComponent {
|
||||
this.recurringDepositAccountDetailsForm.valid &&
|
||||
this.recurringDepositAccountTermsForm.valid &&
|
||||
this.recurringDepositAccountSettingsForm.valid &&
|
||||
(
|
||||
!this.recurringDepositAccountDetailsForm.pristine ||
|
||||
(!this.recurringDepositAccountDetailsForm.pristine ||
|
||||
!this.recurringDepositAccountTermsForm.pristine ||
|
||||
!this.recurringDepositAccountSettingsForm.pristine ||
|
||||
!this.recurringDepositAccountChargesStep.pristine
|
||||
)
|
||||
!this.recurringDepositAccountChargesStep.pristine)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,18 +91,17 @@ export class EditRecurringDepositAccountComponent {
|
||||
...this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetails,
|
||||
...this.recurringDepositAccountTermsStep.recurringDepositAccountTerms,
|
||||
...this.recurringDepositAccountSettingsStep.recurringDepositAccountSettings,
|
||||
...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges,
|
||||
...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/** Retrieves Data of all forms except Currency to submit the data */
|
||||
get recurringDepositAccount() {
|
||||
return {
|
||||
...this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetails,
|
||||
...this.recurringDepositAccountTermsStep.recurringDepositAccountTerms,
|
||||
...this.recurringDepositAccountSettingsStep.recurringDepositAccountSettings,
|
||||
...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges,
|
||||
...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges
|
||||
};
|
||||
}
|
||||
|
||||
@@ -121,17 +122,23 @@ export class EditRecurringDepositAccountComponent {
|
||||
feeOnMonthDay: charge.feeOnMonthDay,
|
||||
feeInterval: charge.feeInterval
|
||||
})),
|
||||
isCalendarInherited: this.recurringDepositAccount.recurringDepositAccount ? this.recurringDepositAccount.recurringDepositAccount : false,
|
||||
isCalendarInherited: this.recurringDepositAccount.recurringDepositAccount
|
||||
? this.recurringDepositAccount.recurringDepositAccount
|
||||
: false,
|
||||
submittedOnDate: this.dateUtils.formatDate(this.recurringDepositAccount.submittedOnDate, dateFormat),
|
||||
expectedFirstDepositOnDate: this.dateUtils.formatDate(this.recurringDepositAccount.expectedFirstDepositOnDate, dateFormat),
|
||||
expectedFirstDepositOnDate: this.dateUtils.formatDate(
|
||||
this.recurringDepositAccount.expectedFirstDepositOnDate,
|
||||
dateFormat
|
||||
),
|
||||
dateFormat,
|
||||
monthDayFormat,
|
||||
locale
|
||||
};
|
||||
|
||||
this.recurringDepositsService.updateRecurringDepositAccount(this.recurringDepositsAccountAndTemplate.id, recurringDepositAccount).subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
this.recurringDepositsService
|
||||
.updateRecurringDepositAccount(this.recurringDepositsAccountAndTemplate.id, recurringDepositAccount)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ActivateRecurringDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ActivateRecurringDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ActivateRecurringDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+17
-8
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./activate-recurring-deposits-account.component.scss']
|
||||
})
|
||||
export class ActivateRecurringDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class ActivateRecurringDepositsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,7 +58,10 @@ export class ActivateRecurringDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createActivateRecurringDepositsAccountForm() {
|
||||
this.activateRecurringDepositsAccountForm = this.formBuilder.group({
|
||||
'activatedOnDate': ['', Validators.required]
|
||||
activatedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,15 +75,20 @@ export class ActivateRecurringDepositsAccountComponent implements OnInit {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevActivatedOnDate: Date = this.activateRecurringDepositsAccountForm.value.activatedOnDate;
|
||||
if (activateRecurringDepositsAccountFormData.activatedOnDate instanceof Date) {
|
||||
activateRecurringDepositsAccountFormData.activatedOnDate = this.dateUtils.formatDate(prevActivatedOnDate, dateFormat);
|
||||
activateRecurringDepositsAccountFormData.activatedOnDate = this.dateUtils.formatDate(
|
||||
prevActivatedOnDate,
|
||||
dateFormat
|
||||
);
|
||||
}
|
||||
const data = {
|
||||
...activateRecurringDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'activate', data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.recurringDepositsService
|
||||
.executeRecurringDepositsAccountCommand(this.accountId, 'activate', data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('AddChargeRecurringDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AddChargeRecurringDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [AddChargeRecurringDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+18
-11
@@ -18,7 +18,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./add-charge-recurring-deposits-account.component.scss']
|
||||
})
|
||||
export class AddChargeRecurringDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum Due Date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum Due Date allowed. */
|
||||
@@ -64,7 +63,7 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit {
|
||||
}
|
||||
|
||||
buildDependencies() {
|
||||
this.recurringDepositsChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => {
|
||||
this.recurringDepositsChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => {
|
||||
this.savingsService.getChargeTemplate(chargeId).subscribe((data: any) => {
|
||||
this.chargeDetails = data;
|
||||
const chargeTimeType = data.chargeTimeType.id;
|
||||
@@ -85,14 +84,17 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit {
|
||||
this.recurringDepositsChargeForm.removeControl('feeOnMonthDay');
|
||||
}
|
||||
if (chargeTimeType.value === 'Monthly Fee') {
|
||||
this.recurringDepositsChargeForm.addControl('feeInterval', new UntypedFormControl(data.feeInterval, Validators.required));
|
||||
this.recurringDepositsChargeForm.addControl(
|
||||
'feeInterval',
|
||||
new UntypedFormControl(data.feeInterval, Validators.required)
|
||||
);
|
||||
} else {
|
||||
this.recurringDepositsChargeForm.removeControl('feeInterval');
|
||||
}
|
||||
this.recurringDepositsChargeForm.patchValue({
|
||||
'amount': data.amount,
|
||||
'chargeCalculationType': data.chargeCalculationType.id,
|
||||
'chargeTimeType': data.chargeTimeType.id
|
||||
amount: data.amount,
|
||||
chargeCalculationType: data.chargeCalculationType.id,
|
||||
chargeTimeType: data.chargeTimeType.id
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -103,10 +105,16 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createRecurringDepositsChargeForm() {
|
||||
this.recurringDepositsChargeForm = this.formBuilder.group({
|
||||
'chargeId': ['', Validators.required],
|
||||
'amount': ['', Validators.required],
|
||||
'chargeCalculationType': [{ value: '', disabled: true }],
|
||||
'chargeTimeType': [{ value: '', disabled: true }]
|
||||
chargeId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
amount: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
chargeCalculationType: [{ value: '', disabled: true }],
|
||||
chargeTimeType: [{ value: '', disabled: true }]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -140,5 +148,4 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ApproveRecurringDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApproveRecurringDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ApproveRecurringDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+18
-10
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./approve-recurring-deposits-account.component.scss']
|
||||
})
|
||||
export class ApproveRecurringDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createApproveRecurringDepositsAccountForm() {
|
||||
this.approveRecurringDepositsAccountForm = this.formBuilder.group({
|
||||
'approvedOnDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
approvedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,16 +76,20 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevApprovedOnDate: Date = this.approveRecurringDepositsAccountForm.value.approvedOnDate;
|
||||
if (approveRecurringDepositsAccountFormData.approvedOnDate instanceof Date) {
|
||||
approveRecurringDepositsAccountFormData.approvedOnDate = this.dateUtils.formatDate(prevApprovedOnDate, dateFormat);
|
||||
approveRecurringDepositsAccountFormData.approvedOnDate = this.dateUtils.formatDate(
|
||||
prevApprovedOnDate,
|
||||
dateFormat
|
||||
);
|
||||
}
|
||||
const data = {
|
||||
...approveRecurringDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'approve', data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.recurringDepositsService
|
||||
.executeRecurringDepositsAccountCommand(this.accountId, 'approve', data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('CloseRecurringDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CloseRecurringDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CloseRecurringDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+25
-16
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./close-recurring-deposits-account.component.scss']
|
||||
})
|
||||
export class CloseRecurringDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Maturity Amount */
|
||||
maturityAmount: any;
|
||||
/** On Account Closure Options */
|
||||
@@ -76,16 +75,25 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createcloseRecurringDepositForm() {
|
||||
this.closeRecurringDepositForm = this.formBuilder.group({
|
||||
'closedOnDate': [new Date(), Validators.required],
|
||||
'maturityAmount': [{ value: this.maturityAmount, disabled: true}],
|
||||
'onAccountClosureId': ['', Validators.required],
|
||||
'paymentTypeId': ['', Validators.required],
|
||||
'accountNumber': '',
|
||||
'chequeNumber': '',
|
||||
'routingCode': '',
|
||||
'receiptNumber': '',
|
||||
'bankNumber': '',
|
||||
'note': ''
|
||||
closedOnDate: [
|
||||
new Date(),
|
||||
Validators.required
|
||||
],
|
||||
maturityAmount: [{ value: this.maturityAmount, disabled: true }],
|
||||
onAccountClosureId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
paymentTypeId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
accountNumber: '',
|
||||
chequeNumber: '',
|
||||
routingCode: '',
|
||||
receiptNumber: '',
|
||||
bankNumber: '',
|
||||
note: ''
|
||||
});
|
||||
}
|
||||
|
||||
@@ -93,7 +101,7 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
||||
* Toggles the display of payment details
|
||||
*/
|
||||
toggleDisplay() {
|
||||
this.showPaymentDetails = !(this.showPaymentDetails);
|
||||
this.showPaymentDetails = !this.showPaymentDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,9 +120,10 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'close', data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.recurringDepositsService
|
||||
.executeRecurringDepositsAccountCommand(this.accountId, 'close', data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('DepositRecurringDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ DepositRecurringDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [DepositRecurringDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+24
-12
@@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./deposit-recurring-deposits-account.component.scss']
|
||||
})
|
||||
export class DepositRecurringDepositsAccountComponent implements OnInit {
|
||||
|
||||
@Input() currency: Currency;
|
||||
|
||||
/** Transactions Amount */
|
||||
@@ -41,7 +40,7 @@ export class DepositRecurringDepositsAccountComponent implements OnInit {
|
||||
action: string;
|
||||
actionName: string;
|
||||
transactionCommand: string;
|
||||
transactionType: { deposit: boolean, withdrawal: boolean } = { deposit: false, withdrawal: false };
|
||||
transactionType: { deposit: boolean; withdrawal: boolean } = { deposit: false, withdrawal: false };
|
||||
|
||||
/**
|
||||
* Retrieves action details transactions template data from `resolve`
|
||||
@@ -62,7 +61,10 @@ export class DepositRecurringDepositsAccountComponent implements OnInit {
|
||||
this.route.data.subscribe((data: { recurringDepositsAccountActionData: any }) => {
|
||||
this.transactionAmount = data.recurringDepositsAccountActionData.amount;
|
||||
this.paymentTypes = data.recurringDepositsAccountActionData.paymentTypeOptions;
|
||||
if (data.recurringDepositsAccountActionData.outstandingChargeAmount && data.recurringDepositsAccountActionData.outstandingChargeAmount > 0) {
|
||||
if (
|
||||
data.recurringDepositsAccountActionData.outstandingChargeAmount &&
|
||||
data.recurringDepositsAccountActionData.outstandingChargeAmount > 0
|
||||
) {
|
||||
this.outstandingChargeAmount = data.recurringDepositsAccountActionData.outstandingChargeAmount;
|
||||
this.transactionAmount = this.transactionAmount + this.outstandingChargeAmount;
|
||||
}
|
||||
@@ -84,10 +86,19 @@ export class DepositRecurringDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createdepositRecurringDepositForm() {
|
||||
this.depositRecurringDepositForm = this.formBuilder.group({
|
||||
'transactionDate': [new Date(), Validators.required],
|
||||
'transactionAmount': [0.0, Validators.required],
|
||||
'paymentTypeId': ['', Validators.required],
|
||||
'note': ''
|
||||
transactionDate: [
|
||||
new Date(),
|
||||
Validators.required
|
||||
],
|
||||
transactionAmount: [
|
||||
0.0,
|
||||
Validators.required
|
||||
],
|
||||
paymentTypeId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ''
|
||||
});
|
||||
}
|
||||
|
||||
@@ -115,7 +126,7 @@ export class DepositRecurringDepositsAccountComponent implements OnInit {
|
||||
* Toggles the display of payment details
|
||||
*/
|
||||
toggleDisplay() {
|
||||
this.showPaymentDetails = !(this.showPaymentDetails);
|
||||
this.showPaymentDetails = !this.showPaymentDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,9 +148,10 @@ export class DepositRecurringDepositsAccountComponent implements OnInit {
|
||||
|
||||
delete data['note'];
|
||||
data['transactionAmount'] = data['transactionAmount'] * 1;
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, this.action, data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.recurringDepositsService
|
||||
.executeRecurringDepositsAccountCommand(this.accountId, this.action, data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('PrematureCloseRecurringDepositAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PrematureCloseRecurringDepositAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [PrematureCloseRecurringDepositAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+17
-9
@@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./premature-close-recurring-deposit-account.component.scss']
|
||||
})
|
||||
export class PrematureCloseRecurringDepositAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -36,12 +35,14 @@ export class PrematureCloseRecurringDepositAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService, ) {
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId'];
|
||||
}
|
||||
|
||||
@@ -58,7 +59,10 @@ export class PrematureCloseRecurringDepositAccountComponent implements OnInit {
|
||||
*/
|
||||
createprematureCloseRecurringDepositsAccountForm() {
|
||||
this.prematureCloseRecurringDepositsAccountForm = this.formBuilder.group({
|
||||
'closedOnDate': ['', Validators.required]
|
||||
closedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,16 +76,20 @@ export class PrematureCloseRecurringDepositAccountComponent implements OnInit {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const prevClosedOnDate: Date = this.prematureCloseRecurringDepositsAccountForm.value.closedOnDate;
|
||||
if (prematureCloseRecurringDepositsAccountFormData.closedOnDate instanceof Date) {
|
||||
prematureCloseRecurringDepositsAccountFormData.closedOnDate = this.dateUtils.formatDate(prevClosedOnDate, dateFormat);
|
||||
prematureCloseRecurringDepositsAccountFormData.closedOnDate = this.dateUtils.formatDate(
|
||||
prevClosedOnDate,
|
||||
dateFormat
|
||||
);
|
||||
}
|
||||
const data = {
|
||||
...prematureCloseRecurringDepositsAccountFormData,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'prematureClose', data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.recurringDepositsService
|
||||
.executeRecurringDepositsAccountCommand(this.accountId, 'prematureClose', data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('RecurringDepositsAccountActionsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RecurringDepositsAccountActionsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RecurringDepositsAccountActionsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+24
-26
@@ -8,35 +8,34 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./recurring-deposits-account-actions.component.scss']
|
||||
})
|
||||
export class RecurringDepositsAccountActionsComponent {
|
||||
|
||||
/** Flag object to store possible actions and render appropriate UI to the user */
|
||||
actions: {
|
||||
'Activate': boolean
|
||||
'Undo Activation': boolean
|
||||
'Undo Approval': boolean
|
||||
'Approve': boolean
|
||||
'Reject': boolean
|
||||
'Withdrawn by Client': boolean
|
||||
'Add Charge': boolean
|
||||
'Premature Close': boolean
|
||||
'Close': boolean
|
||||
'Deposit': boolean
|
||||
'Withdrawal': boolean
|
||||
Activate: boolean;
|
||||
'Undo Activation': boolean;
|
||||
'Undo Approval': boolean;
|
||||
Approve: boolean;
|
||||
Reject: boolean;
|
||||
'Withdrawn by Client': boolean;
|
||||
'Add Charge': boolean;
|
||||
'Premature Close': boolean;
|
||||
Close: boolean;
|
||||
Deposit: boolean;
|
||||
Withdrawal: boolean;
|
||||
} = {
|
||||
'Activate': false,
|
||||
'Undo Activation': false,
|
||||
'Undo Approval': false,
|
||||
'Approve': false,
|
||||
'Reject': false,
|
||||
'Withdrawn by Client': false,
|
||||
'Add Charge': false,
|
||||
'Premature Close': false,
|
||||
'Close': false,
|
||||
'Deposit': false,
|
||||
'Withdrawal': false
|
||||
};
|
||||
Activate: false,
|
||||
'Undo Activation': false,
|
||||
'Undo Approval': false,
|
||||
Approve: false,
|
||||
Reject: false,
|
||||
'Withdrawn by Client': false,
|
||||
'Add Charge': false,
|
||||
'Premature Close': false,
|
||||
Close: false,
|
||||
Deposit: false,
|
||||
Withdrawal: false
|
||||
};
|
||||
|
||||
currency: Currency;
|
||||
currency: Currency;
|
||||
|
||||
/**
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
@@ -50,5 +49,4 @@ export class RecurringDepositsAccountActionsComponent {
|
||||
const name = this.route.snapshot.params['name'];
|
||||
this.actions[name] = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('RejectRecurringDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RejectRecurringDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RejectRecurringDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+14
-10
@@ -8,7 +8,6 @@ import { RecurringDepositsService } from '../../recurring-deposits.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
|
||||
/**
|
||||
* Reject Recurring Deposits Account Component
|
||||
*/
|
||||
@@ -18,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./reject-recurring-deposits-account.component.scss']
|
||||
})
|
||||
export class RejectRecurringDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -36,12 +34,14 @@ export class RejectRecurringDepositsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId'];
|
||||
}
|
||||
|
||||
@@ -58,8 +58,11 @@ export class RejectRecurringDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createRejectRecurringDepositsAccountForm() {
|
||||
this.rejectRecurringDepositsAccountForm = this.formBuilder.group({
|
||||
'rejectedOnDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
rejectedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -80,9 +83,10 @@ export class RejectRecurringDepositsAccountComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'reject', data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.recurringDepositsService
|
||||
.executeRecurringDepositsAccountCommand(this.accountId, 'reject', data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('UndoApprovalRecurringDepositsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UndoApprovalRecurringDepositsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [UndoApprovalRecurringDepositsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+16
-12
@@ -15,7 +15,6 @@ import { RecurringDepositsService } from '../../recurring-deposits.service';
|
||||
styleUrls: ['./undo-approval-recurring-deposits-account.component.scss']
|
||||
})
|
||||
export class UndoApprovalRecurringDepositsAccountComponent implements OnInit {
|
||||
|
||||
/** Undo Approval Recurring Deposits Account form. */
|
||||
undoApprovalRecurringDepositsAccountForm: UntypedFormGroup;
|
||||
/** Recurring Deposits Account Id */
|
||||
@@ -30,10 +29,12 @@ export class UndoApprovalRecurringDepositsAccountComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private recurringDepositsService: RecurringDepositsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
private router: Router
|
||||
) {
|
||||
this.undoCommand = 'undoapproval'; // Default command
|
||||
this.undoAction = this.route.snapshot.params['name'];
|
||||
if (this.undoAction === 'Undo Activation') {
|
||||
@@ -54,7 +55,7 @@ export class UndoApprovalRecurringDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
createUndoApprovalRecurringDepositsAccountForm() {
|
||||
this.undoApprovalRecurringDepositsAccountForm = this.formBuilder.group({
|
||||
'note': ['']
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -64,17 +65,20 @@ export class UndoApprovalRecurringDepositsAccountComponent implements OnInit {
|
||||
*/
|
||||
submit() {
|
||||
const data = {
|
||||
...this.undoApprovalRecurringDepositsAccountForm.value,
|
||||
...this.undoApprovalRecurringDepositsAccountForm.value
|
||||
};
|
||||
if (this.undoAction === 'Undo Activation') {
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, this.undoCommand, data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.recurringDepositsService
|
||||
.executeRecurringDepositsAccountCommand(this.accountId, this.undoCommand, data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
} else {
|
||||
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'undoapproval', data).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.recurringDepositsService
|
||||
.executeRecurringDepositsAccountCommand(this.accountId, 'undoapproval', data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user