build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
+2
-3
@@ -8,9 +8,8 @@ describe('ActivateSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ActivateSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ActivateSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+12
-9
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./activate-savings-account.component.scss']
|
||||
})
|
||||
export class ActivateSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class ActivateSavingsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting 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.snapshot.params['savingAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,7 +58,10 @@ export class ActivateSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
createActivateSavingsAccountForm() {
|
||||
this.activateSavingsAccountForm = this.formBuilder.group({
|
||||
'activatedOnDate': ['', Validators.required]
|
||||
activatedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -82,5 +86,4 @@ export class ActivateSavingsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('AddChargeSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AddChargeSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [AddChargeSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+27
-18
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./add-charge-savings-account.component.scss']
|
||||
})
|
||||
export class AddChargeSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum Due Date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum Due Date allowed. */
|
||||
@@ -40,12 +39,14 @@ export class AddChargeSavingsAccountComponent implements OnInit {
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private savingsService: SavingsService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private savingsService: SavingsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
||||
this.savingsChargeOptions = data.savingsAccountActionData.chargeOptions;
|
||||
});
|
||||
@@ -62,7 +63,7 @@ export class AddChargeSavingsAccountComponent implements OnInit {
|
||||
}
|
||||
|
||||
buildDependencies() {
|
||||
this.savingsChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => {
|
||||
this.savingsChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => {
|
||||
this.savingsService.getChargeTemplate(chargeId).subscribe((data: any) => {
|
||||
this.chargeDetails = data;
|
||||
const chargeTimeType = data.chargeTimeType.id;
|
||||
@@ -83,14 +84,17 @@ export class AddChargeSavingsAccountComponent implements OnInit {
|
||||
this.savingsChargeForm.removeControl('feeOnMonthDay');
|
||||
}
|
||||
if (chargeTimeType.value === 'Monthly Fee') {
|
||||
this.savingsChargeForm.addControl('feeInterval', new UntypedFormControl(data.feeInterval, Validators.required));
|
||||
this.savingsChargeForm.addControl(
|
||||
'feeInterval',
|
||||
new UntypedFormControl(data.feeInterval, Validators.required)
|
||||
);
|
||||
} else {
|
||||
this.savingsChargeForm.removeControl('feeInterval');
|
||||
}
|
||||
this.savingsChargeForm.patchValue({
|
||||
'amount': data.amount,
|
||||
'chargeCalculationType': data.chargeCalculationType.id,
|
||||
'chargeTimeType': data.chargeTimeType.id
|
||||
amount: data.amount,
|
||||
chargeCalculationType: data.chargeCalculationType.id,
|
||||
chargeTimeType: data.chargeTimeType.id
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -101,10 +105,16 @@ export class AddChargeSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
createSavingsChargeForm() {
|
||||
this.savingsChargeForm = 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 }]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -134,9 +144,8 @@ export class AddChargeSavingsAccountComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.savingsService.createSavingsCharge(this.savingAccountId, 'charges', savingsCharge).subscribe( () => {
|
||||
this.savingsService.createSavingsCharge(this.savingAccountId, 'charges', savingsCharge).subscribe(() => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ApplyAnnualFeesSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApplyAnnualFeesSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ApplyAnnualFeesSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+24
-19
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./apply-annual-fees-savings-account.component.scss']
|
||||
})
|
||||
export class ApplyAnnualFeesSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -39,12 +38,14 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting 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.snapshot.params['savingAccountId'];
|
||||
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
||||
this.savingsAccountData = data.savingsAccountActionData;
|
||||
@@ -65,8 +66,11 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
createApplyAnnualFeesForm() {
|
||||
this.applyAnnualFeesForm = this.formBuilder.group({
|
||||
'dueDate': ['', Validators.required],
|
||||
'amount': ['']
|
||||
dueDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
amount: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -75,12 +79,12 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
applyCharge() {
|
||||
const charges: any[] = this.savingsAccountData.charges;
|
||||
charges.forEach((charge: any) => {
|
||||
if (charge.name === 'Annual fee - INR') {
|
||||
this.chargeId = charge.id;
|
||||
this.applyAnnualFeesForm.get('amount').patchValue(charge.amount);
|
||||
}
|
||||
});
|
||||
charges.forEach((charge: any) => {
|
||||
if (charge.name === 'Annual fee - INR') {
|
||||
this.chargeId = charge.id;
|
||||
this.applyAnnualFeesForm.get('amount').patchValue(charge.amount);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,9 +104,10 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.savingsService.executeSavingsAccountChargesCommand(this.accountId, 'paycharge', data, this.chargeId).subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
this.savingsService
|
||||
.executeSavingsAccountChargesCommand(this.accountId, 'paycharge', data, this.chargeId)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ApproveSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ApproveSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ApproveSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+13
-10
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./approve-savings-account.component.scss']
|
||||
})
|
||||
export class ApproveSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class ApproveSavingsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting 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.snapshot.params['savingAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class ApproveSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
createApproveSavingsAccountForm() {
|
||||
this.approveSavingsAccountForm = this.formBuilder.group({
|
||||
'approvedOnDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
approvedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,5 +87,4 @@ export class ApproveSavingsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('CloseSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CloseSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CloseSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+19
-13
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./close-savings-account.component.scss']
|
||||
})
|
||||
export class CloseSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -41,12 +40,14 @@ export class CloseSavingsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting 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.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
||||
this.paymentTypeOptions = data.savingsAccountActionData[0].paymentTypeOptions;
|
||||
this.transactionAmount = data.savingsAccountActionData[1].summary.accountBalance;
|
||||
@@ -68,10 +69,13 @@ export class CloseSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
createCloseSavingsAccountForm() {
|
||||
this.closeSavingsAccountForm = this.formBuilder.group({
|
||||
'closedOnDate': ['', Validators.required],
|
||||
'withdrawBalance': [false],
|
||||
'postInterestValidationOnClosure': [false],
|
||||
'note': ['']
|
||||
closedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
withdrawBalance: [false],
|
||||
postInterestValidationOnClosure: [false],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -81,7 +85,10 @@ export class CloseSavingsAccountComponent implements OnInit {
|
||||
buildDependencies() {
|
||||
this.closeSavingsAccountForm.get('withdrawBalance').valueChanges.subscribe((value: boolean) => {
|
||||
if (value) {
|
||||
this.closeSavingsAccountForm.addControl('amount', new UntypedFormControl({value: this.transactionAmount, disabled: true}));
|
||||
this.closeSavingsAccountForm.addControl(
|
||||
'amount',
|
||||
new UntypedFormControl({ value: this.transactionAmount, disabled: true })
|
||||
);
|
||||
this.closeSavingsAccountForm.addControl('paymentTypeId', new UntypedFormControl(''));
|
||||
} else {
|
||||
this.closeSavingsAccountForm.removeControl('amount');
|
||||
@@ -131,5 +138,4 @@ export class CloseSavingsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ManageSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ManageSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ManageSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+46
-26
@@ -13,7 +13,6 @@ import { SystemService } from 'app/system/system.service';
|
||||
styleUrls: ['./manage-savings-account.component.scss']
|
||||
})
|
||||
export class ManageSavingsAccountComponent implements OnInit {
|
||||
|
||||
@Input() currency: Currency;
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
@@ -28,16 +27,16 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
reasonOptions: any = [];
|
||||
|
||||
transactionType: {
|
||||
holdamount: boolean,
|
||||
blockaccount: boolean,
|
||||
blockdeposit: boolean,
|
||||
blockwithdrawal: boolean
|
||||
holdamount: boolean;
|
||||
blockaccount: boolean;
|
||||
blockdeposit: boolean;
|
||||
blockwithdrawal: boolean;
|
||||
} = {
|
||||
holdamount: false,
|
||||
blockaccount: false,
|
||||
blockdeposit: false,
|
||||
blockwithdrawal: false
|
||||
};
|
||||
holdamount: false,
|
||||
blockaccount: false,
|
||||
blockdeposit: false,
|
||||
blockwithdrawal: false
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
@@ -47,13 +46,15 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private savingsService: SavingsService,
|
||||
private dateUtils: Dates,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private systemService: SystemService,
|
||||
private settingsService: SettingsService) {
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.transactionCommand = this.route.snapshot.params['name'].toLowerCase().replaceAll(' ', '');
|
||||
this.transactionType[this.transactionCommand] = true;
|
||||
this.savingAccountId = this.route.snapshot.params['savingAccountId'];
|
||||
@@ -65,8 +66,12 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
this.createManageSavingsAccountForm();
|
||||
if (this.transactionType.holdamount || this.transactionType.blockaccount
|
||||
|| this.transactionType.blockdeposit || this.transactionType.blockwithdrawal) {
|
||||
if (
|
||||
this.transactionType.holdamount ||
|
||||
this.transactionType.blockaccount ||
|
||||
this.transactionType.blockdeposit ||
|
||||
this.transactionType.blockwithdrawal
|
||||
) {
|
||||
this.getCodeValues();
|
||||
}
|
||||
}
|
||||
@@ -100,13 +105,25 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
createManageSavingsAccountForm() {
|
||||
if (this.transactionType.holdamount) {
|
||||
this.manageSavingsAccountForm = this.formBuilder.group({
|
||||
'reasonForBlock': ['', Validators.required],
|
||||
'transactionDate': ['', Validators.required],
|
||||
'transactionAmount': [0.0, Validators.required]
|
||||
reasonForBlock: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
transactionDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
transactionAmount: [
|
||||
0.0,
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
} else {
|
||||
this.manageSavingsAccountForm = this.formBuilder.group({
|
||||
'reasonForBlock': ['', Validators.required]
|
||||
reasonForBlock: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -131,12 +148,14 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
command = 'holdAmount';
|
||||
payload['transactionAmount'] = payload['transactionAmount'] * 1;
|
||||
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.savingAccountId, command, payload).subscribe((response: any) => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
this.savingsService
|
||||
.executeSavingsAccountTransactionsCommand(this.savingAccountId, command, payload)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
} else {
|
||||
payload = {
|
||||
... this.manageSavingsAccountForm.value
|
||||
...this.manageSavingsAccountForm.value
|
||||
};
|
||||
command = 'block';
|
||||
if (this.transactionType.blockdeposit) {
|
||||
@@ -145,10 +164,11 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
command = 'blockDebit';
|
||||
}
|
||||
|
||||
this.savingsService.executeSavingsAccountCommand(this.savingAccountId, command, payload).subscribe((response: any) => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
this.savingsService
|
||||
.executeSavingsAccountCommand(this.savingAccountId, command, payload)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('PostInterestAsOnSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PostInterestAsOnSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [PostInterestAsOnSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+17
-12
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./post-interest-as-on-savings-account.component.scss']
|
||||
})
|
||||
export class PostInterestAsOnSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class PostInterestAsOnSavingsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting 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.snapshot.params['savingAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,7 +58,10 @@ export class PostInterestAsOnSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
createPostInterestSavingsAccountForm() {
|
||||
this.postInterestSavingsAccountForm = this.formBuilder.group({
|
||||
'transactionDate': ['', Validators.required]
|
||||
transactionDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -79,9 +83,10 @@ export class PostInterestAsOnSavingsAccountComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'postInterestAsOn', data).subscribe(() => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
this.savingsService
|
||||
.executeSavingsAccountTransactionsCommand(this.accountId, 'postInterestAsOn', data)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('RejectSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RejectSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [RejectSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+13
-10
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./reject-savings-account.component.scss']
|
||||
})
|
||||
export class RejectSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class RejectSavingsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting 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.snapshot.params['savingAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class RejectSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
createRejectSavingsAccountForm() {
|
||||
this.rejectSavingsAccountForm = this.formBuilder.group({
|
||||
'rejectedOnDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
rejectedOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,5 +87,4 @@ export class RejectSavingsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('SavingAccountActionsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SavingAccountActionsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SavingAccountActionsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -12,36 +12,35 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./saving-account-actions.component.scss']
|
||||
})
|
||||
export class SavingAccountActionsComponent {
|
||||
|
||||
/** Flag object to store possible actions and render appropriate UI to the user */
|
||||
actions: {
|
||||
'Approve': boolean
|
||||
'Reject': boolean
|
||||
'Withdrawal': boolean
|
||||
'Deposit': boolean
|
||||
'Activate': boolean
|
||||
'Close': boolean
|
||||
'Undo Approval': boolean
|
||||
'Post Interest As On': boolean
|
||||
'Assign Staff': boolean
|
||||
'Add Charge': boolean
|
||||
'Unassign Staff': boolean
|
||||
'Withdrawn by Client': boolean
|
||||
'Apply Annual Fees': boolean
|
||||
'Hold Amount': boolean
|
||||
'Block Account': boolean
|
||||
'Unblock Account': boolean
|
||||
'Block Deposit': boolean
|
||||
'Unblock Deposit': boolean
|
||||
'Block Withdrawal': boolean
|
||||
'Unblock Withdrawal': boolean
|
||||
Approve: boolean;
|
||||
Reject: boolean;
|
||||
Withdrawal: boolean;
|
||||
Deposit: boolean;
|
||||
Activate: boolean;
|
||||
Close: boolean;
|
||||
'Undo Approval': boolean;
|
||||
'Post Interest As On': boolean;
|
||||
'Assign Staff': boolean;
|
||||
'Add Charge': boolean;
|
||||
'Unassign Staff': boolean;
|
||||
'Withdrawn by Client': boolean;
|
||||
'Apply Annual Fees': boolean;
|
||||
'Hold Amount': boolean;
|
||||
'Block Account': boolean;
|
||||
'Unblock Account': boolean;
|
||||
'Block Deposit': boolean;
|
||||
'Unblock Deposit': boolean;
|
||||
'Block Withdrawal': boolean;
|
||||
'Unblock Withdrawal': boolean;
|
||||
} = {
|
||||
'Approve': false,
|
||||
'Reject': false,
|
||||
'Withdrawal': false,
|
||||
'Deposit': false,
|
||||
'Activate': false,
|
||||
'Close': false,
|
||||
Approve: false,
|
||||
Reject: false,
|
||||
Withdrawal: false,
|
||||
Deposit: false,
|
||||
Activate: false,
|
||||
Close: false,
|
||||
'Undo Approval': false,
|
||||
'Post Interest As On': false,
|
||||
'Assign Staff': false,
|
||||
@@ -72,5 +71,4 @@ export class SavingAccountActionsComponent {
|
||||
const name = this.route.snapshot.params['name'];
|
||||
this.actions[name] = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SavingsAccountAssignStaffComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SavingsAccountAssignStaffComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SavingsAccountAssignStaffComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+13
-10
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./savings-account-assign-staff.component.scss']
|
||||
})
|
||||
export class SavingsAccountAssignStaffComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -39,12 +38,14 @@ export class SavingsAccountAssignStaffComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting 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.snapshot.params['savingAccountId'];
|
||||
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
||||
this.savingsAccountData = data.savingsAccountActionData;
|
||||
@@ -65,8 +66,11 @@ export class SavingsAccountAssignStaffComponent implements OnInit {
|
||||
*/
|
||||
createSavingsAssignStaffForm() {
|
||||
this.savingsAssignStaffForm = this.formBuilder.group({
|
||||
'toSavingsOfficerId': [''],
|
||||
'assignmentDate': ['', Validators.required]
|
||||
toSavingsOfficerId: [''],
|
||||
assignmentDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -92,5 +96,4 @@ export class SavingsAccountAssignStaffComponent implements OnInit {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('TransactionsComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SavingsAccountTransactionsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SavingsAccountTransactionsComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+29
-20
@@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./savings-account-transactions.component.scss']
|
||||
})
|
||||
export class SavingsAccountTransactionsComponent implements OnInit {
|
||||
|
||||
/** Minimum Due Date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum Due Date allowed. */
|
||||
@@ -27,16 +26,16 @@ export class SavingsAccountTransactionsComponent implements OnInit {
|
||||
savingAccountTransactionForm: UntypedFormGroup;
|
||||
/** savings account transaction payment options. */
|
||||
paymentTypeOptions: {
|
||||
id: number,
|
||||
name: string,
|
||||
description: string,
|
||||
isCashPayment: boolean,
|
||||
position: number
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
isCashPayment: boolean;
|
||||
position: number;
|
||||
}[];
|
||||
/** 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;
|
||||
/** saving account's Id */
|
||||
@@ -52,12 +51,14 @@ export class SavingsAccountTransactionsComponent 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 savingsService: SavingsService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private savingsService: SavingsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
||||
this.paymentTypeOptions = data.savingsAccountActionData.paymentTypeOptions;
|
||||
if (data.savingsAccountActionData.currency) {
|
||||
@@ -82,10 +83,16 @@ export class SavingsAccountTransactionsComponent implements OnInit {
|
||||
*/
|
||||
createSavingAccountTransactionForm() {
|
||||
this.savingAccountTransactionForm = 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: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -126,8 +133,10 @@ export class SavingsAccountTransactionsComponent implements OnInit {
|
||||
locale
|
||||
};
|
||||
data['transactionAmount'] = data['transactionAmount'] * 1;
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.savingAccountId, this.transactionCommand, data).subscribe(res => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
this.savingsService
|
||||
.executeSavingsAccountTransactionsCommand(this.savingAccountId, this.transactionCommand, data)
|
||||
.subscribe((res) => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SavingsAccountUnassignStaffComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SavingsAccountUnassignStaffComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SavingsAccountUnassignStaffComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+12
-9
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./savings-account-unassign-staff.component.scss']
|
||||
})
|
||||
export class SavingsAccountUnassignStaffComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class SavingsAccountUnassignStaffComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting 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.snapshot.params['savingAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,7 +58,10 @@ export class SavingsAccountUnassignStaffComponent implements OnInit {
|
||||
*/
|
||||
createSavingsUnassignStaffForm() {
|
||||
this.savingsUnassignStaffForm = this.formBuilder.group({
|
||||
'unassignedDate': ['', Validators.required]
|
||||
unassignedDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -82,5 +86,4 @@ export class SavingsAccountUnassignStaffComponent implements OnInit {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('UndoApprovalSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UndoApprovalSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [UndoApprovalSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+8
-8
@@ -15,7 +15,6 @@ import { SavingsService } from 'app/savings/savings.service';
|
||||
styleUrls: ['./undo-approval-savings-account.component.scss']
|
||||
})
|
||||
export class UndoApprovalSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Undo Approval Savings Account form. */
|
||||
undoApprovalSavingsAccountForm: UntypedFormGroup;
|
||||
/** Savings Account Id */
|
||||
@@ -27,10 +26,12 @@ export class UndoApprovalSavingsAccountComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
* @param {Router} router Router
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private savingsService: SavingsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private savingsService: SavingsService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {
|
||||
this.accountId = this.route.snapshot.params['savingAccountId'];
|
||||
}
|
||||
|
||||
@@ -46,7 +47,7 @@ export class UndoApprovalSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
createUndoApprovalSavingsAccountForm() {
|
||||
this.undoApprovalSavingsAccountForm = this.formBuilder.group({
|
||||
'note': ['']
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -56,11 +57,10 @@ export class UndoApprovalSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
submit() {
|
||||
const data = {
|
||||
...this.undoApprovalSavingsAccountForm.value,
|
||||
...this.undoApprovalSavingsAccountForm.value
|
||||
};
|
||||
this.savingsService.executeSavingsAccountCommand(this.accountId, 'undoapproval', data).subscribe(() => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('WithdrawByClientSavingsAccountComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ WithdrawByClientSavingsAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [WithdrawByClientSavingsAccountComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+13
-10
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./withdraw-by-client-savings-account.component.scss']
|
||||
})
|
||||
export class WithdrawByClientSavingsAccountComponent implements OnInit {
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -35,12 +34,14 @@ export class WithdrawByClientSavingsAccountComponent implements OnInit {
|
||||
* @param {Router} router Router
|
||||
* @param {SettingsService} settingsService Setting 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.snapshot.params['savingAccountId'];
|
||||
}
|
||||
|
||||
@@ -57,8 +58,11 @@ export class WithdrawByClientSavingsAccountComponent implements OnInit {
|
||||
*/
|
||||
createWithdrawSavingsAccountForm() {
|
||||
this.withdrawSavingsAccountForm = this.formBuilder.group({
|
||||
'withdrawnOnDate': ['', Validators.required],
|
||||
'note': ['']
|
||||
withdrawnOnDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
note: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,5 +87,4 @@ export class WithdrawByClientSavingsAccountComponent implements OnInit {
|
||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user