From f643b159492f742a9c6583e0234954dbb0fa8cd1 Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Fri, 2 Feb 2024 22:00:22 -0600 Subject: [PATCH] Fix search entities view for savings and deposits accounts --- src/app/clients/clients-routing.module.ts | 2 +- .../clients-view/clients-view.component.html | 2 +- .../general-tab/general-tab.component.html | 10 +++++----- .../charges-tab/charges-tab.component.ts | 2 +- .../general-tab/general-tab.component.html | 1 + ...curring-deposits-account-view.component.ts | 2 +- .../notifications-page.component.ts | 2 +- .../loan-product-settings-step.component.ts | 3 +++ .../search-page/search-page.component.ts | 14 +++++++++++--- src/app/search/search.model.ts | 19 +++++++++++++++++++ .../notifications-tray.component.ts | 2 +- 11 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 src/app/search/search.model.ts diff --git a/src/app/clients/clients-routing.module.ts b/src/app/clients/clients-routing.module.ts index 404e26089..bdafa0702 100644 --- a/src/app/clients/clients-routing.module.ts +++ b/src/app/clients/clients-routing.module.ts @@ -251,7 +251,7 @@ const routes: Routes = [ loadChildren: () => import('../savings/savings.module').then(m => m.SavingsModule) }, { - path: 'recurringdeposits', + path: 'recurring-deposits-accounts', loadChildren: () => import('../deposits/recurring-deposits/recurring-deposits.module').then(m => m.RecurringDepositsModule) }, { diff --git a/src/app/clients/clients-view/clients-view.component.html b/src/app/clients/clients-view/clients-view.component.html index 8bef8431f..a482ad1f6 100644 --- a/src/app/clients/clients-view/clients-view.component.html +++ b/src/app/clients/clients-view/clients-view.component.html @@ -115,7 +115,7 @@ + [routerLink]="['recurring-deposits-accounts', 'create-recurring-deposits-account']">{{"labels.buttons.New Recurring Deposit Account" | translate}} diff --git a/src/app/clients/clients-view/general-tab/general-tab.component.html b/src/app/clients/clients-view/general-tab/general-tab.component.html index 73dc41b30..3e549fb1b 100644 --- a/src/app/clients/clients-view/general-tab/general-tab.component.html +++ b/src/app/clients/clients-view/general-tab/general-tab.component.html @@ -476,7 +476,7 @@ @@ -484,12 +484,12 @@ @@ -498,7 +498,7 @@ + [routerLink]="['../', 'recurring-deposits-accounts', row.id, 'general']" class="select-row"> @@ -525,7 +525,7 @@ + [routerLink]="['../', 'recurring-deposits-accounts', row.id, 'general']" class="select-row"> diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts index 7c8c6a941..0b30a8b21 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts @@ -211,7 +211,7 @@ export class ChargesTabComponent implements OnInit { private reload() { const clientId = this.recurringDepositsAccountData.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/recurringdeposits`, { skipLocationChange: true }) + this.router.navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.html b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.html index f83563f52..f6c94179d 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.html +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.html @@ -37,6 +37,7 @@ + {{"labels.inputs.Deposit Frequency" | translate }} {{recurringDepositsAccountData.recurringFrequency}}  {{recurringDepositsAccountData.recurringFrequencyType.value}} diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts index 5dcf0f50a..77a1ae0e6 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts @@ -148,7 +148,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit { reload() { const clientId = this.recurringDepositsAccountData.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/recurringdeposits`, { skipLocationChange: true }) + this.router.navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } diff --git a/src/app/notifications/notifications-page/notifications-page.component.ts b/src/app/notifications/notifications-page/notifications-page.component.ts index b83de3588..c425bbe69 100644 --- a/src/app/notifications/notifications-page/notifications-page.component.ts +++ b/src/app/notifications/notifications-page/notifications-page.component.ts @@ -33,7 +33,7 @@ export class NotificationsPageComponent implements OnInit { 'center' : '/centers/', 'shareAccount' : '/shares-accounts/', 'fixedDeposit' : '/fixed-deposits-accounts/', - 'recurringDepositAccount': '/recurringdeposits/', + 'recurringDepositAccount': '/recurring-deposits-accounts/', 'savingsAccount' : '/savings-accounts/', 'shareProduct': '/products/share-products/', 'loanProduct' : '/products/loan-products/' diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts index 32f095ab3..22b74676d 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts @@ -112,6 +112,8 @@ export class LoanProductSettingsStepComponent implements OnInit { 'enableDownPayment': this.loanProductsTemplate.enableDownPayment, 'enableInstallmentLevelDelinquency': this.loanProductsTemplate.enableInstallmentLevelDelinquency, 'loanScheduleType': this.loanProductsTemplate.loanScheduleType.code, + 'useDueForRepaymentsConfigurations': this.loanProductsTemplate.useDueForRepaymentsConfigurations, + 'allowAccrualPostingInArrears': this.loanProductsTemplate.allowAccrualPostingInArrears }); this.isAdvancedTransactionProcessingStrategy = LoanProducts.isAdvancedPaymentAllocationStrategy(transactionProcessingStrategyCode); @@ -243,6 +245,7 @@ export class LoanProductSettingsStepComponent implements OnInit { 'dueDaysForRepaymentEvent': [''], 'overDueDaysForRepaymentEvent': [''], 'loanScheduleType': [LoanProducts.LOAN_SCHEDULE_TYPE_CUMULATIVE, Validators.required], + 'allowAccrualPostingInArrears': [false] }); } diff --git a/src/app/search/search-page/search-page.component.ts b/src/app/search/search-page/search-page.component.ts index ecfdca9d1..33254c7f5 100644 --- a/src/app/search/search-page/search-page.component.ts +++ b/src/app/search/search-page/search-page.component.ts @@ -3,6 +3,7 @@ import { Component, ViewChild } from '@angular/core'; import { MatPaginator } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { Router, ActivatedRoute } from '@angular/router'; +import { SearchData } from '../search.model'; /** * Search Page Component @@ -16,7 +17,7 @@ export class SearchPageComponent { /** Flags if number of search results exceed 200 */ overload: boolean; /** Datasource for loans disbursal table */ - dataSource: MatTableDataSource; + dataSource: MatTableDataSource; /** Displayed Columns for serach results */ displayedColumns: string[] = ['entityType', 'entityName', 'entityAccount', 'externalId', 'parentType', 'parentName', 'details']; /** Paginator for the table */ @@ -31,6 +32,7 @@ export class SearchPageComponent { constructor(private route: ActivatedRoute, private router: Router) { this.route.data.subscribe(( data: { searchResults: any }) => { + console.log(data.searchResults); this.dataSource = new MatTableDataSource(data.searchResults); this.dataSource.paginator = this.paginator; this.hasResults = (data.searchResults.length > 0); @@ -45,7 +47,7 @@ export class SearchPageComponent { * Returns link to entity view page. * @param {any} entity Entity */ - navigate(entity: any) { + navigate(entity: SearchData) { switch (entity.entityType) { case 'CLIENT': this.router.navigate(['clients', entity.entityId, 'general']); @@ -60,7 +62,13 @@ export class SearchPageComponent { this.router.navigate(['clients', entity.parentId, 'shares-accounts', entity.entityId]); break; case 'SAVING': - this.router.navigate(['clients', entity.parentId, 'savings-accounts', entity.entityId, 'transactions']); + if (entity.subEntityType === 'depositAccountType.recurringDeposit') { + this.router.navigate(['clients', entity.parentId, 'recurring-deposits-accounts', entity.entityId, 'transactions']); + } else if (entity.subEntityType === 'depositAccountType.fixedDeposit') { + this.router.navigate(['clients', entity.parentId, 'fixed-deposits-accounts', entity.entityId, 'transactions']); + } else if (entity.subEntityType === 'depositAccountType.savingsDeposit') { + this.router.navigate(['clients', entity.parentId, 'savings-accounts', entity.entityId, 'transactions']); + } break; case 'LOAN': this.router.navigate(['clients', entity.parentId, 'loans-accounts', entity.entityId, 'general']); diff --git a/src/app/search/search.model.ts b/src/app/search/search.model.ts new file mode 100644 index 000000000..51260b86c --- /dev/null +++ b/src/app/search/search.model.ts @@ -0,0 +1,19 @@ +export interface SearchData { + entityId: number; + entityAccountNo: string; + entityExternalId: string; + entityName: string; + entityType: string; + parentId: number; + parentName: string; + entityStatus: EntityStatus; + parentType: string; + subEntityType: string; +} + +export interface EntityStatus { + id: number; + code: string; + value: string; +} + diff --git a/src/app/shared/notifications-tray/notifications-tray.component.ts b/src/app/shared/notifications-tray/notifications-tray.component.ts index 1b101c5ff..c1170d142 100644 --- a/src/app/shared/notifications-tray/notifications-tray.component.ts +++ b/src/app/shared/notifications-tray/notifications-tray.component.ts @@ -40,7 +40,7 @@ export class NotificationsTrayComponent implements OnInit, OnDestroy { 'center' : '/centers/', 'shareAccount' : '/shares-accounts/', 'fixedDeposit' : '/fixed-deposits-accounts/', - 'recurringDepositAccount': '/recurringdeposits/', + 'recurringDepositAccount': '/recurring-deposits-accounts/', 'savingsAccount' : '/savings-accounts/', 'shareProduct': '/products/share-products/', 'loanProduct' : '/products/loan-products/'