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('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 });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user