diff --git a/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.html b/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.html
index 8b257b561..95803a7d0 100644
--- a/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.html
+++ b/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.html
@@ -70,6 +70,7 @@
| Sr. | +{{ slab.srNo }} | +Particular | +{{ slab.description }} | +From | +{{ slab.fromPeriod }} | +To | +{{ slab.toPeriod ?? '—' }} | +Period Type | +{{ slab.periodTypeLabel }} | +Annual Rate (%) | ++ {{ slab.annualInterestRate | number: '1.2-2' }} + | +
|---|
| {{ 'labels.inputs.Period' | translate }} |
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.ts
index fdf29b5f3..d194eeb9a 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.ts
@@ -21,7 +21,7 @@ import {
MatRow
} from '@angular/material/table';
import { trigger, state, style, transition, animate } from '@angular/animations';
-import { NgIf, NgSwitch, TitleCasePipe } from '@angular/common';
+import { NgIf, NgSwitch, TitleCasePipe, DecimalPipe } from '@angular/common';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { MatStepperPrevious, MatStepperNext } from '@angular/material/stepper';
import { DateFormatPipe } from '../../../../pipes/date-format.pipe';
@@ -69,7 +69,28 @@ export class RecurringDepositsAccountInterestRateChartStepComponent implements O
@Input() recurringDepositsAccountTemplate: any;
@Input() recurringDepositsAccountProductTemplate: any;
- /** Interest Rate Chart Data */
+ /**
+ * CBS base rate chart loaded from the active base-interest-rate service.
+ * When set, this table is shown instead of the legacy accountChart.chartSlabs.
+ */
+ @Input() set rdInterestRates(rates: any[]) {
+ this._rdInterestRates = rates || [];
+ this._activeRdVersion = this._rdInterestRates.find((v: any) => v.isActive) ?? this._rdInterestRates[0] ?? null;
+ }
+
+ _rdInterestRates: any[] = [];
+ _activeRdVersion: any = null;
+
+ readonly rdSlabColumns = [
+ 'srNo',
+ 'description',
+ 'fromPeriod',
+ 'toPeriod',
+ 'periodTypeLabel',
+ 'annualInterestRate'
+ ];
+
+ /** Interest Rate Chart Data (legacy – used when no custom rate chart is available) */
interestRateChartData: any = [];
/** Columns to be displayed in interest rate chart table. */
chartSlabsDisplayedColumns: any[] = [
@@ -88,7 +109,7 @@ export class RecurringDepositsAccountInterestRateChartStepComponent implements O
'incentiveType',
'amount'
];
- /** Additional Column to disblac incentives table */
+ /** Additional Column to display incentives table */
chartSlabsIncentivesDisplayedColumns: string[] = ['incentives'];
/** Expand Chart Slab Index used in the view */
expandChartSlabIndex: number;
diff --git a/src/app/products/products-routing.module.ts b/src/app/products/products-routing.module.ts
index 0c49649fd..c6cb43e70 100644
--- a/src/app/products/products-routing.module.ts
+++ b/src/app/products/products-routing.module.ts
@@ -49,6 +49,7 @@ import { EditTaxComponentComponent } from './manage-tax-components/edit-tax-comp
import { ViewTaxGroupComponent } from './manage-tax-groups/view-tax-group/view-tax-group.component';
import { ShareProductsDividendsComponent } from './share-products/dividends-share-product/dividends.components';
import { CreateRecurringDepositProductComponent } from './recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component';
+import { BaseRecurringDepositInterestRateChartComponent } from './recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component';
import { CreateDividendComponent } from './share-products/create-dividend/create-dividend.component';
import { ViewFixedDepositProductComponent } from './fixed-deposit-products/view-fixed-deposit-product/view-fixed-deposit-product.component';
import { ViewDividendComponent } from './share-products/view-dividend/view-dividend.component';
@@ -129,6 +130,8 @@ import { FixedDepositGeneralTabComponent } from './fixed-deposit-products/view-f
import { FixedDepositDatatableTabComponent } from './fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-datatable-tab/fixed-deposit-datatable-tab.component';
import { RecurringDepositGeneralTabComponent } from './recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-general-tab/recurring-deposit-general-tab.component';
import { RecurringDepositDatatableTabComponent } from './recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-datatable-tab/recurring-deposit-datatable-tab.component';
+import { RdInterestRatesTabComponent } from './recurring-deposit-products/view-recurring-deposit-product/rd-interest-rates-tab/rd-interest-rates-tab.component';
+import { rdInterestRatesResolver } from './recurring-deposit-products/view-recurring-deposit-product/rd-interest-rates-tab/rd-interest-rates.resolver';
import { ShareProductGeneralTabComponent } from './share-products/view-share-product/share-product-general-tab/share-product-general-tab.component';
import { ShareProductDatatableTabComponent } from './share-products/view-share-product/share-product-datatable-tab/share-product-datatable-tab.component';
import { ShareProductDatatablesResolver } from './share-products/share-product-datatables.resolver';
@@ -652,6 +655,14 @@ const routes: Routes = [
path: 'recurring-deposit-products',
data: { title: 'Recurring Deposit Products', breadcrumb: 'Recurring Deposit Products' },
children: [
+ {
+ path: 'base-interest-rates',
+ component: BaseRecurringDepositInterestRateChartComponent,
+ data: { title: 'CBS Base Interest Rates', breadcrumb: 'Base Interest Rates' },
+ resolve: {
+ recurringDepositProductsTemplate: RecurringDepositProductsTemplateResolver
+ }
+ },
{
path: 'create',
component: CreateRecurringDepositProductComponent,
@@ -704,6 +715,14 @@ const routes: Routes = [
}
]
},
+ {
+ path: 'interest-rates',
+ component: RdInterestRatesTabComponent,
+ data: { title: 'CBS Base Chart', breadcrumb: 'CBS Base Chart', routeParamBreadcrumb: false },
+ resolve: {
+ rdInterestRates: rdInterestRatesResolver
+ }
+ },
{
path: 'edit',
data: { title: 'Edit Recurring Deposit Product', breadcrumb: 'edit', routeParamBreadcrumb: false },
diff --git a/src/app/products/products.module.ts b/src/app/products/products.module.ts
index 27675d51e..d98b4d3a9 100644
--- a/src/app/products/products.module.ts
+++ b/src/app/products/products.module.ts
@@ -84,6 +84,7 @@ import { ViewTaxGroupComponent } from './manage-tax-groups/view-tax-group/view-t
import { ShareProductsDividendsComponent } from './share-products/dividends-share-product/dividends.components';
import { ViewRecurringDepositProductComponent } from './recurring-deposit-products/view-recurring-deposit-product/view-recurring-deposit-product.component';
import { CreateRecurringDepositProductComponent } from './recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component';
+import { BaseRecurringDepositInterestRateChartComponent } from './recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component';
import { RecurringDepositProductAccountingStepComponent } from './recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component';
import { RecurringDepositProductChargesStepComponent } from './recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component';
import { RecurringDepositProductCurrencyStepComponent } from './recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component';
@@ -213,6 +214,7 @@ import { AdvancedAccountingMappingRuleComponent } from './loan-products/loan-pro
DepositProductIncentiveFormDialogComponent,
ViewRecurringDepositProductComponent,
CreateRecurringDepositProductComponent,
+ BaseRecurringDepositInterestRateChartComponent,
RecurringDepositProductAccountingStepComponent,
RecurringDepositProductChargesStepComponent,
RecurringDepositProductCurrencyStepComponent,
diff --git a/src/app/products/products.service.ts b/src/app/products/products.service.ts
index 97daf2e91..82e0f2035 100644
--- a/src/app/products/products.service.ts
+++ b/src/app/products/products.service.ts
@@ -526,6 +526,26 @@ export class ProductsService {
return this.http.put(`/recurringdepositproducts/${recurringDepositProductId}`, recurringDepositProduct);
}
+ /** Returns the active CBS base interest-rate version(s). */
+ getAllRdInterestRates(): Observable
+
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
new file mode 100644
index 000000000..00de402dc
--- /dev/null
+++ b/src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.scss
@@ -0,0 +1,95 @@
+/**
+ * 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
new file mode 100644
index 000000000..811810cfc
--- /dev/null
+++ b/src/app/products/recurring-deposit-products/base-recurring-deposit-interest-rate-chart/base-recurring-deposit-interest-rate-chart.component.ts
@@ -0,0 +1,121 @@
+/**
+ * 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/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.html b/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.html
index b0882ab54..3b01d9081 100644
--- a/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.html
+++ b/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.html
@@ -69,12 +69,60 @@
+
+
+ @if (recurringDepositProductsTemplate?.chartTemplate) {
+
+
+ CBS Base Recurring Deposit Interest Chart+This chart is the master template used when creating a recurring deposit product. +
+
+ @if (saveMessage) {
+
+ }
+
+ } @else {
+ Loading CBS base chart... + } + +
+
+
+
+
+ @if (isHistoryLoading) {
+
+
+ Chart History+Previous CBS base chart versions are listed here for comparison and audit. +Loading history... + } @else if (rdInterestRateHistory.length === 0) { +No history found for the CBS base chart. + } @else { +{{ version.remarks }} + } + +
-
+
+ } @else {
+
+
+
+ @if (activeBaseVersion.remarks) {
+
+
+ Active
+ {{ activeBaseVersion.versionLabel }}+ +{{ activeBaseVersion.remarks }} + } + +
Loading CBS base chart... + }
-
diff --git a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.scss b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.scss
index af9f4c075..c04c383f8 100644
--- a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.scss
+++ b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.scss
@@ -5,3 +5,134 @@
* 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/.
*/
+
+$primary: #1353a0;
+
+.rdp-container {
+ max-width: 960px;
+ margin: 0 auto;
+ padding: 24px 16px;
+}
+
+.rdp-header {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ margin-bottom: 20px;
+
+ &__icon {
+ font-size: 20px;
+ color: $primary;
+ }
+
+ &__title {
+ margin: 0;
+ font-size: 22px;
+ font-weight: 500;
+ }
+}
+
+.rdp-tabs {
+ background: var(--md-sys-color-surface, #fff);
+ border-radius: 8px;
+ box-shadow: 0 2px 8px rgb(0 0 0 / 8%);
+
+ ::ng-deep {
+ .mat-mdc-tab-header {
+ border-bottom: 1px solid rgb(0 0 0 / 8%);
+ }
+
+ .mat-mdc-tab {
+ min-width: 100px;
+ padding: 0 12px;
+ height: 52px;
+ }
+
+ .mat-mdc-tab-body-wrapper {
+ min-height: 200px;
+ }
+
+ .mat-mdc-tab-body {
+ overflow: visible !important;
+ }
+
+ .mat-mdc-tab-body-content {
+ overflow: visible !important;
+ }
+ }
+}
+
+.rdp-tab-icon {
+ margin-right: 8px;
+ font-size: 14px;
+}
+
+.rdp-tab-content {
+ padding: 24px 16px;
+}
+
+.base-rate-card {
+ padding: 16px;
+ border: 1px solid #dbe4f0;
+ border-radius: 14px;
+ background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
+}
+
+.base-rate-header {
+ display: flex;
+ align-items: start;
+ justify-content: space-between;
+ gap: 12px;
+ margin-bottom: 12px;
+}
+
+.base-rate-title {
+ margin: 0;
+ font-size: 18px;
+ font-weight: 600;
+}
+
+.base-rate-meta {
+ margin: 6px 0 0;
+ color: #5b6b7f;
+ display: flex;
+ gap: 12px;
+ flex-wrap: wrap;
+}
+
+.base-rate-badge {
+ padding: 4px 10px;
+ border-radius: 999px;
+ background: #dcfce7;
+ color: #166534;
+ font-size: 12px;
+ font-weight: 700;
+}
+
+.base-rate-remarks {
+ margin: 0 0 12px;
+ color: #334155;
+}
+
+.base-rate-table {
+ width: 100%;
+ border-collapse: collapse;
+}
+
+.rdp-action-bar {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 20px;
+ padding: 16px 0;
+ border-top: 1px solid rgb(0 0 0 / 8%);
+
+ &__cancel {
+ color: rgb(0 0 0 / 60%);
+ }
+
+ &__right {
+ display: flex;
+ gap: 12px;
+ }
+}
diff --git a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.ts b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.ts
index 2c39bef1d..aa5fb1ff0 100644
--- a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.ts
+++ b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.ts
@@ -15,16 +15,26 @@ import { RecurringDepositProductDetailsStepComponent } from '../recurring-deposi
import { RecurringDepositProductCurrencyStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component';
import { RecurringDepositProductTermsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component';
import { RecurringDepositProductSettingsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-settings-step/recurring-deposit-product-settings-step.component';
-import { RecurringDepositProductInterestRateChartStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component';
import { RecurringDepositProductChargesStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component';
import { RecurringDepositProductAccountingStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component';
+import {
+ MatTable,
+ MatColumnDef,
+ MatHeaderCellDef,
+ MatHeaderCell,
+ MatCellDef,
+ MatCell,
+ MatHeaderRowDef,
+ MatHeaderRow,
+ MatRowDef,
+ MatRow
+} from '@angular/material/table';
/** Custom Services */
import { ProductsService } from 'app/products/products.service';
import { SettingsService } from 'app/settings/settings.service';
import { Accounting } from 'app/core/utils/accounting';
-import { MatStepper, MatStepperIcon, MatStep, MatStepLabel } from '@angular/material/stepper';
-import { FaIconComponent } from '@fortawesome/angular-fontawesome';
+import { MatTabsModule } from '@angular/material/tabs';
import { RecurringDepositProductPreviewStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-preview-step/recurring-deposit-product-preview-step.component';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
@@ -34,19 +44,24 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
styleUrls: ['./edit-recurring-deposit-product.component.scss'],
imports: [
...STANDALONE_SHARED_IMPORTS,
- MatStepper,
- MatStepperIcon,
- FaIconComponent,
- MatStep,
- MatStepLabel,
+ MatTabsModule,
RecurringDepositProductDetailsStepComponent,
RecurringDepositProductCurrencyStepComponent,
RecurringDepositProductTermsStepComponent,
RecurringDepositProductSettingsStepComponent,
- RecurringDepositProductInterestRateChartStepComponent,
RecurringDepositProductChargesStepComponent,
RecurringDepositProductAccountingStepComponent,
- RecurringDepositProductPreviewStepComponent
+ RecurringDepositProductPreviewStepComponent,
+ MatTable,
+ MatColumnDef,
+ MatHeaderCellDef,
+ MatHeaderCell,
+ MatCellDef,
+ MatCell,
+ MatHeaderRowDef,
+ MatHeaderRow,
+ MatRowDef,
+ MatRow
]
})
export class EditRecurringDepositProductComponent {
@@ -64,8 +79,6 @@ export class EditRecurringDepositProductComponent {
recurringDepositProductTermsStep: RecurringDepositProductTermsStepComponent;
@ViewChild(RecurringDepositProductSettingsStepComponent, { static: true })
recurringDepositProductSettingsStep: RecurringDepositProductSettingsStepComponent;
- @ViewChild(RecurringDepositProductInterestRateChartStepComponent, { static: true })
- recurringDepositProductInterestRateChartStep: RecurringDepositProductInterestRateChartStepComponent;
@ViewChild(RecurringDepositProductChargesStepComponent, { static: true })
recurringDepositProductChargesStep: RecurringDepositProductChargesStepComponent;
@ViewChild(RecurringDepositProductAccountingStepComponent, { static: true })
@@ -73,6 +86,16 @@ export class EditRecurringDepositProductComponent {
recurringDepositProductsTemplate: any;
accountingRuleData: string[] = [];
+ rdInterestRates: any[] = [];
+ readonly rdSlabColumns = [
+ 'srNo',
+ 'description',
+ 'fromPeriod',
+ 'toPeriod',
+ 'periodTypeLabel',
+ 'annualInterestRate'
+ ];
+ selectedTabIndex = 0;
/**
* @param {ActivatedRoute} route Activated Route.
@@ -84,6 +107,14 @@ export class EditRecurringDepositProductComponent {
constructor() {
this.route.data.subscribe((data: { recurringDepositProductAndTemplate: any }) => {
this.recurringDepositProductsTemplate = data.recurringDepositProductAndTemplate;
+ this.productsService.getRdBaseInterestRates().subscribe({
+ next: (rates: any[]) => {
+ this.rdInterestRates = rates || [];
+ },
+ error: () => {
+ this.rdInterestRates = [];
+ }
+ });
});
this.accountingRuleData = this.accounting.getAccountingRulesForSavings();
}
@@ -104,43 +135,55 @@ export class EditRecurringDepositProductComponent {
return this.recurringDepositProductSettingsStep.recurringDepositProductSettingsForm;
}
- get recurringDepositProductInterestRateChartForm() {
- return this.recurringDepositProductInterestRateChartStep.recurringDepositProductInterestRateChartForm;
- }
-
get recurringDepositProductAccountingForm() {
return this.recurringDepositProductAccountingStep.recurringDepositProductAccountingForm;
}
+ get totalTabs(): number {
+ return this.recurringDepositProductFormValidAndNotPrinstine ? 7 : 6;
+ }
+
get recurringDepositProductFormValidAndNotPrinstine() {
return (
this.recurringDepositProductDetailsForm.valid &&
this.recurringDepositProductCurrencyForm.valid &&
this.recurringDepositProductTermsForm.valid &&
this.recurringDepositProductSettingsForm.valid &&
- this.recurringDepositProductInterestRateChartForm.valid &&
this.recurringDepositProductAccountingForm.valid &&
(this.recurringDepositProductDetailsForm.pristine ||
this.recurringDepositProductCurrencyForm.pristine ||
this.recurringDepositProductTermsForm.pristine ||
this.recurringDepositProductSettingsForm.pristine ||
- this.recurringDepositProductInterestRateChartForm.pristine ||
this.recurringDepositProductAccountingForm.pristine)
);
}
+ get activeBaseVersion() {
+ return this.rdInterestRates.find((version: any) => version.isActive) ?? this.rdInterestRates[0] ?? null;
+ }
+
+ get activeBaseSlabs() {
+ return this.activeBaseVersion?.slabs || [];
+ }
+
get recurringDepositProduct() {
return {
...this.recurringDepositProductDetailsStep.recurringDepositProductDetails,
...this.recurringDepositProductCurrencyStep.recurringDepositProductCurrency,
...this.recurringDepositProductTermsStep.recurringDepositProductTerms,
...this.recurringDepositProductSettingsStep.recurringDepositProductSettings,
- ...this.recurringDepositProductInterestRateChartStep.recurringDepositProductInterestRateChart,
...this.recurringDepositProductChargesStep.recurringDepositProductCharges,
...this.recurringDepositProductAccountingStep.recurringDepositProductAccounting
};
}
+ get recurringDepositProductPreview() {
+ return {
+ ...this.recurringDepositProduct,
+ rdSlabs: this.activeBaseSlabs
+ };
+ }
+
submit() {
// TODO: Update once language and date settings are setup
const recurringDepositProduct = {
@@ -152,8 +195,9 @@ export class EditRecurringDepositProductComponent {
recurringDepositProduct.description = '';
}
delete recurringDepositProduct.advancedAccountingRules;
+ const productId = this.recurringDepositProductsTemplate.id;
this.productsService
- .updateRecurringDepositProduct(this.recurringDepositProductsTemplate.id, recurringDepositProduct)
+ .updateRecurringDepositProduct(productId, recurringDepositProduct)
.subscribe((response: any) => {
this.router.navigate(['../'], { relativeTo: this.route });
});
diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.html b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.html
index df813724b..7b799e488 100644
--- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.html
+++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.html
@@ -6,325 +6,104 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
-
+
+
+
+ {{ 'labels.heading.Edit Recurring Deposit Product' | translate }}+
+
+
+
+
+
+
+
+
+ @if (activeBaseVersion) {
+
+
+
+ } @else {
+
+
-
+
+ Active
+ {{ activeBaseVersion.versionLabel }}+ +{{ activeBaseVersion.remarks }} + } -
Loading CBS base chart... + } +
+
+
+
+
+
+ |
|---|