From 61b0244fa026762303bf0054540fa2688fd998b4 Mon Sep 17 00:00:00 2001 From: Jaanu423 Date: Thu, 21 May 2026 21:15:45 +0530 Subject: [PATCH] feat: senior citizen rate fix, joint ownership cap, FD/RD UI improvements - Senior citizen interest rate correctly sent in FD/RD create payload (isSeniorCitizen, seniorCitizenInterestRate, nominalAnnualInterestRate override) - Joint account ownership capped at 100%: Add Holder/Partner button disabled when 100% reached; dialog enforces remaining share as max across all account types - FD/RD interest rate chart step: rate calculator with tenure, senior citizen toggle, maturity preview - FD/RD preview step improvements - Base FD interest rate chart component added under fixed-deposit-products - Base recurring deposit interest rate chart component removed (replaced) - Savings account details step: joint holder improvements - Products routing and module updated for base FD rate chart Co-Authored-By: Claude Sonnet 4.6 --- .../add-related-client-dialog.component.html | 26 +- .../add-related-client-dialog.component.scss | 25 ++ .../add-related-client-dialog.component.ts | 11 +- ...urrent-account-details-step.component.html | 2 + .../current-account-details-step.component.ts | 6 +- ...reate-fixed-deposit-account.component.html | 1 + .../create-fixed-deposit-account.component.ts | 22 ++ ...eposit-account-details-step.component.html | 1 + ...-deposit-account-details-step.component.ts | 3 +- ...nt-interest-rate-chart-step.component.html | 130 +++++-- ...nt-interest-rate-chart-step.component.scss | 296 ++++++++++++++- ...ount-interest-rate-chart-step.component.ts | 39 +- ...eposit-account-preview-step.component.html | 35 +- ...eposit-account-preview-step.component.scss | 48 +++ ...-deposit-account-preview-step.component.ts | 18 + ...-recurring-deposits-account.component.html | 3 + ...te-recurring-deposits-account.component.ts | 17 + ...posits-account-details-step.component.html | 1 + ...deposits-account-details-step.component.ts | 3 +- ...nt-interest-rate-chart-step.component.html | 126 ++++++- ...nt-interest-rate-chart-step.component.scss | 300 ++++++++++++++- ...ount-interest-rate-chart-step.component.ts | 35 +- ...posits-account-preview-step.component.html | 47 ++- ...posits-account-preview-step.component.scss | 48 +++ ...deposits-account-preview-step.component.ts | 13 + ...base-fd-interest-rate-chart.component.html | 355 ++++++++++++++++++ ...base-fd-interest-rate-chart.component.scss | 216 +++++++++++ .../base-fd-interest-rate-chart.component.ts | 236 ++++++++++++ src/app/products/products-routing.module.ts | 6 + src/app/products/products.component.html | 19 + src/app/products/products.module.ts | 2 - ...deposit-interest-rate-chart.component.html | 119 ------ ...deposit-interest-rate-chart.component.scss | 95 ----- ...g-deposit-interest-rate-chart.component.ts | 121 ------ ...avings-account-details-step.component.html | 1 + .../savings-account-details-step.component.ts | 3 +- src/environments/.env.ts | 4 +- 37 files changed, 1998 insertions(+), 435 deletions(-) create mode 100644 src/app/products/fixed-deposit-products/base-fd-interest-rate-chart/base-fd-interest-rate-chart.component.html create mode 100644 src/app/products/fixed-deposit-products/base-fd-interest-rate-chart/base-fd-interest-rate-chart.component.scss create mode 100644 src/app/products/fixed-deposit-products/base-fd-interest-rate-chart/base-fd-interest-rate-chart.component.ts delete mode 100644 src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.html delete mode 100644 src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.scss delete mode 100644 src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.ts diff --git a/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.html b/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.html index 2cf0ae0b6..cf0f71695 100644 --- a/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.html +++ b/src/app/current-accounts/current-account-stepper/current-account-details-step/add-related-client-dialog/add-related-client-dialog.component.html @@ -106,20 +106,38 @@
2 Ownership Share + @if (maxShare < 100) { + Max available: {{ maxShare }}% + }
+
+ +
+ +
+
+

CBS Base Interest Rate

+

+ Manage and activate CBS base interest rate slabs used for Fixed and Recurring Deposit products +

+
+ +
+
+
- -
- - - @if (recurringDepositProductsTemplate?.chartTemplate) { - - - -
- - @if (saveMessage) { - {{ saveMessage }} - } -
- } @else { -

Loading CBS base chart...

- } - -
-
-
-

Chart History

-

Previous CBS base chart versions are listed here for comparison and audit.

-
-
- - @if (isHistoryLoading) { -

Loading history...

- } @else if (rdInterestRateHistory.length === 0) { -

No history found for the CBS base chart.

- } @else { - - @for (version of rdInterestRateHistory; track version.id) { - - - - - {{ version.versionLabel }} - - {{ version.isActive ? 'Active' : 'Inactive' }} - - - - - From {{ version.effectiveFromDate }} - To {{ version.effectiveToDate || 'Current' }} - - - - @if (version.remarks) { -

{{ version.remarks }}

- } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Sr.{{ slab.srNo }}Description{{ slab.description }}From{{ slab.fromPeriod }}To - {{ slab.toPeriod !== null && slab.toPeriod !== undefined ? slab.toPeriod : 'N/A' }} - Period Type{{ slab.periodTypeLabel }}Annual Rate (%){{ slab.annualInterestRate | number: '1.2-2' }}
-
- } -
- } -
-
diff --git a/src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.scss b/src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.scss deleted file mode 100644 index 00de402dc..000000000 --- a/src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.scss +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright since 2025 Mifos Initiative - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -.page-layout { - display: flex; - flex-direction: column; - gap: 1.25rem; -} - -.page-header { - display: flex; - align-items: end; - justify-content: space-between; -} - -.page-subtitle { - margin: 0.25rem 0 0; - color: #6b7280; -} - -.actions-row { - display: flex; - align-items: center; - gap: 1rem; -} - -.save-message { - color: #2563eb; - font-weight: 600; -} - -.history-section { - margin-top: 1rem; - padding-top: 0.5rem; - border-top: 1px solid #e5e7eb; -} - -.section-header { - display: flex; - align-items: end; - justify-content: space-between; - margin-bottom: 0.75rem; -} - -.section-subtitle { - margin: 0.25rem 0 0; - color: #6b7280; -} - -.version-header { - display: inline-flex; - align-items: center; - gap: 0.75rem; - flex-wrap: wrap; -} - -.meta-text { - margin-left: 0.75rem; - color: #6b7280; - font-size: 0.85rem; -} - -.active-badge, -.inactive-badge { - display: inline-flex; - align-items: center; - padding: 0.2rem 0.5rem; - border-radius: 999px; - font-size: 0.75rem; - font-weight: 600; -} - -.active-badge { - background: #dcfce7; - color: #166534; -} - -.inactive-badge { - background: #f3f4f6; - color: #4b5563; -} - -.remarks-text { - margin: 0 0 0.75rem; - color: #374151; -} - -.history-table { - width: 100%; -} diff --git a/src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.ts b/src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.ts deleted file mode 100644 index 811810cfc..000000000 --- a/src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.ts +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Copyright since 2025 Mifos Initiative - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -import { Component, OnInit, inject } from '@angular/core'; -import { ProductsService } from 'app/products/products.service'; -import { RecurringDepositProductInterestRateChartStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component'; -import { MatButton } from '@angular/material/button'; -import { DecimalPipe } from '@angular/common'; -import { - MatTable, - MatColumnDef, - MatHeaderCellDef, - MatHeaderCell, - MatCellDef, - MatCell, - MatHeaderRowDef, - MatHeaderRow, - MatRowDef, - MatRow -} from '@angular/material/table'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module'; - -@Component({ - selector: 'mifosx-base-recurring-deposit-interest-rate-chart', - templateUrl: './base-recurring-deposit-interest-rate-chart.component.html', - styleUrls: ['./base-recurring-deposit-interest-rate-chart.component.scss'], - imports: [ - ...STANDALONE_SHARED_IMPORTS, - MatButton, - MatExpansionModule, - MatTable, - MatColumnDef, - MatHeaderCellDef, - MatHeaderCell, - MatCellDef, - MatCell, - MatHeaderRowDef, - MatHeaderRow, - MatRowDef, - MatRow, - DecimalPipe, - RecurringDepositProductInterestRateChartStepComponent - ] -}) -export class BaseRecurringDepositInterestRateChartComponent implements OnInit { - private productsService = inject(ProductsService); - - recurringDepositProductsTemplate: any; - rdInterestRates: any[] = []; - rdInterestRateHistory: any[] = []; - readonly historySlabColumns = [ - 'srNo', - 'description', - 'fromPeriod', - 'toPeriod', - 'periodTypeLabel', - 'annualInterestRate' - ]; - isSaving = false; - isHistoryLoading = false; - saveMessage = ''; - - ngOnInit(): void { - this.productsService.getRecurringDepositProductsTemplate().subscribe({ - next: (template: any) => (this.recurringDepositProductsTemplate = template), - error: () => (this.recurringDepositProductsTemplate = null) - }); - - this.loadBaseRates(); - this.loadBaseRateHistory(); - } - - get chartStep(): RecurringDepositProductInterestRateChartStepComponent | null { - return null; - } - - save(stepComponent: RecurringDepositProductInterestRateChartStepComponent): void { - this.isSaving = true; - this.saveMessage = ''; - const payload = stepComponent.modifiedRdInterestRatePayload; - this.productsService.saveRdBaseInterestRates(payload).subscribe({ - next: () => { - this.saveMessage = 'CBS base chart saved successfully.'; - this.loadBaseRates(); - this.loadBaseRateHistory(); - this.isSaving = false; - }, - error: () => { - this.saveMessage = 'Unable to save CBS base chart.'; - this.isSaving = false; - } - }); - } - - private loadBaseRates(): void { - this.productsService.getRdBaseInterestRates().subscribe({ - next: (rates: any[]) => (this.rdInterestRates = rates || []), - error: () => (this.rdInterestRates = []) - }); - } - - private loadBaseRateHistory(): void { - this.isHistoryLoading = true; - this.productsService.getRdBaseInterestRateHistory().subscribe({ - next: (history: any[]) => { - this.rdInterestRateHistory = history || []; - this.isHistoryLoading = false; - }, - error: () => { - this.rdInterestRateHistory = []; - this.isHistoryLoading = false; - } - }); - } -} diff --git a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.html b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.html index 5ac5521e6..5d2511450 100644 --- a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.html +++ b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.html @@ -226,6 +226,7 @@ color="primary" type="button" class="soa-add-btn" + [disabled]="totalJointSharePercentage >= 100" (click)="openAddJointHolderDialog()" > person_add Add Holder diff --git a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts index ac67782d2..93cf17372 100644 --- a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts +++ b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts @@ -334,11 +334,12 @@ export class SavingsAccountDetailsStepComponent implements OnInit { ...(this.primaryClientId ? [this.primaryClientId] : []), ...this.jointHolders.map((h: any) => h.clientId).filter(Boolean) ]; + const maxSharePercentage = Math.max(0, 100 - this.totalJointSharePercentage); const ref = this.dialog.open(AddRelatedClientDialogComponent, { width: '500px', panelClass: 'arc-dialog-panel', disableClose: true, - data: { excludedClientIds } + data: { excludedClientIds, maxSharePercentage } }); ref.afterClosed().subscribe((result) => { if (result) { diff --git a/src/environments/.env.ts b/src/environments/.env.ts index 82fcafb96..c8f9fe9b3 100644 --- a/src/environments/.env.ts +++ b/src/environments/.env.ts @@ -9,8 +9,8 @@ /* tslint:disable */ export default { 'mifos_x': { - 'version': '260520', - 'hash': 'bf3e26a0' + 'version': '260521', + 'hash': '846b2484' }, 'allow_switching_backend_instance': true };