Skip to content

Commit 80edd12

Browse files
refactor: identify annual fee charges by chargeTimeType ID instead of name string
1 parent 0dc3890 commit 80edd12

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
139139

140140
if (this.recurringDepositsAccountData.charges && this.recurringDepositsAccountData.status.value === 'Matured') {
141141
this.charges.forEach((element: any) => {
142-
if (element.name === 'Annual fee - INR') {
142+
if (element.chargeTimeType?.id === 7) {
143143
this.buttonConfig.addOption({
144144
name: 'Apply Annual Fees',
145145
taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT'
@@ -157,7 +157,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
157157
}
158158
if (this.recurringDepositsAccountData.charges) {
159159
this.charges.forEach((element: any) => {
160-
if (element.name === 'Annual fee - INR') {
160+
if (element.chargeTimeType?.id === 7) {
161161
this.buttonConfig.addOption({
162162
name: 'Apply Annual Fees',
163163
taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT'

src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit {
9292
applyCharge() {
9393
const charges: any[] = this.savingsAccountData.charges;
9494
charges.forEach((charge: any) => {
95-
if (charge.name === 'Annual fee - INR') {
95+
if (charge.chargeTimeType?.id === 7) {
9696
this.chargeId = charge.id;
9797
this.applyAnnualFeesForm.get('amount').patchValue(charge.amount);
9898
}

src/app/savings/savings-account-view/savings-account-view.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class SavingsAccountViewComponent implements OnInit {
156156
if (this.savingsAccountData.charges) {
157157
const charges: any[] = this.savingsAccountData.charges;
158158
charges.forEach((charge: any) => {
159-
if (charge.name === 'Annual fee - INR') {
159+
if (charge.chargeTimeType?.id === 7) {
160160
this.buttonConfig.addOption({
161161
name: 'Apply Annual Fees',
162162
taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT'

src/app/shares/shares-account-view/shares-account-view.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class SharesAccountViewComponent implements OnInit {
118118
if (this.sharesAccountData.charges) {
119119
const charges: any[] = this.sharesAccountData.charges;
120120
charges.forEach((charge: any) => {
121-
if (charge.name === 'Annual fee - INR') {
121+
if (charge.chargeTimeType?.id === 7) {
122122
this.buttonConfig.addOption({
123123
name: 'Apply Anuual Fees',
124124
taskPermissionName: 'APPLYANNUALFEE_SAVINGSACCOUNT'

0 commit comments

Comments
 (0)