diff --git a/src/app/current-accounts/create-current-account/create-current-account.component.html b/src/app/current-accounts/create-current-account/create-current-account.component.html index 900db006a..7a79e519a 100644 --- a/src/app/current-accounts/create-current-account/create-current-account.component.html +++ b/src/app/current-accounts/create-current-account/create-current-account.component.html @@ -12,9 +12,7 @@

Create Current Account

-
- Pick a product, confirm currency, set digital channels and review before submit. -
+
Pick a product, confirm currency and review before submit.
@@ -78,34 +76,7 @@ - - - - - Digital - -
- @if (currentAccountProductTemplate) { - - } - -
- - - -
-
-
- - + diff --git a/src/app/current-accounts/create-current-account/create-current-account.component.ts b/src/app/current-accounts/create-current-account/create-current-account.component.ts index 9aa74d548..6c682a919 100644 --- a/src/app/current-accounts/create-current-account/create-current-account.component.ts +++ b/src/app/current-accounts/create-current-account/create-current-account.component.ts @@ -57,8 +57,8 @@ export class CreateCurrentAccountComponent { currentAccountProductTemplate: any; /** Currently visible wizard tab (0-indexed). */ selectedTabIndex = 0; - /** Total wizard tabs — Product, Currency, Digital, Preview. */ - private readonly totalTabs = 4; + /** Total wizard tabs — Product, Currency, Preview. */ + private readonly totalTabs = 3; @ViewChild(CurrentAccountDetailsStepComponent, { static: true }) currentAccountDetailsStep: CurrentAccountDetailsStepComponent; diff --git a/src/app/current-accounts/current-account-actions/activate-current-account/activate-current-account.component.html b/src/app/current-accounts/current-account-actions/activate-current-account/activate-current-account.component.html index 7b9e69031..19abc5fdc 100644 --- a/src/app/current-accounts/current-account-actions/activate-current-account/activate-current-account.component.html +++ b/src/app/current-accounts/current-account-actions/activate-current-account/activate-current-account.component.html @@ -30,18 +30,6 @@ } - - - Opening Balance - - ₹  - @if (minRequiredOpeningBalance) { - Minimum required: ₹{{ minRequiredOpeningBalance }} - } - @if (activateCurrentAccountForm.controls.openingBalance.hasError('min')) { - Opening balance must be at least ₹{{ minRequiredOpeningBalance ?? 0 }} - } - diff --git a/src/app/current-accounts/current-account-actions/activate-current-account/activate-current-account.component.ts b/src/app/current-accounts/current-account-actions/activate-current-account/activate-current-account.component.ts index 98701b637..ae85c6d92 100644 --- a/src/app/current-accounts/current-account-actions/activate-current-account/activate-current-account.component.ts +++ b/src/app/current-accounts/current-account-actions/activate-current-account/activate-current-account.component.ts @@ -7,7 +7,7 @@ */ /** Angular Imports */ -import { Component, OnInit, Input, inject } from '@angular/core'; +import { Component, OnInit, inject } from '@angular/core'; import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { Dates } from 'app/core/utils/dates'; @@ -36,8 +36,6 @@ export class ActivateCurrentAccountComponent implements OnInit { private router = inject(Router); private settingsService = inject(SettingsService); - @Input() minRequiredOpeningBalance: number | null = null; - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -71,18 +69,10 @@ export class ActivateCurrentAccountComponent implements OnInit { * Creates the activate current account form. */ createActivateCurrentAccountForm() { - const minBalance = this.minRequiredOpeningBalance ?? 0; this.activateCurrentAccountForm = this.formBuilder.group({ activatedOnDate: [ '', Validators.required - ], - openingBalance: [ - minBalance, - [ - Validators.required, - Validators.min(minBalance) - ] ] }); } diff --git a/src/app/current-accounts/current-account-actions/approve-current-account/approve-current-account.component.html b/src/app/current-accounts/current-account-actions/approve-current-account/approve-current-account.component.html index 78322c36e..cfb7b6a87 100644 --- a/src/app/current-accounts/current-account-actions/approve-current-account/approve-current-account.component.html +++ b/src/app/current-accounts/current-account-actions/approve-current-account/approve-current-account.component.html @@ -10,6 +10,7 @@
+

This approves and activates the account in one step -- it goes straight to Active.

{{ 'labels.inputs.Approved On Date' | translate }} diff --git a/src/app/current-accounts/current-account-actions/approve-current-account/approve-current-account.component.ts b/src/app/current-accounts/current-account-actions/approve-current-account/approve-current-account.component.ts index ca8791c73..f71db9650 100644 --- a/src/app/current-accounts/current-account-actions/approve-current-account/approve-current-account.component.ts +++ b/src/app/current-accounts/current-account-actions/approve-current-account/approve-current-account.component.ts @@ -81,8 +81,9 @@ export class ApproveCurrentAccountComponent implements OnInit { } /** - * Submits the form and approves the current account, - * if successful redirects to the current account. + * Submits the form, approves the current account, then immediately activates it on the same + * date -- Approve and Activate are still two separate Fineract commands underneath (each shows + * up in the audit trail), but the officer only sees and clicks through one step. */ submit() { const approveCurrentAccountFormData = this.approveCurrentAccountForm.value; @@ -98,7 +99,16 @@ export class ApproveCurrentAccountComponent implements OnInit { locale }; this.currentAccountsService.executeCurrentAccountCommand(this.accountId, 'approve', data).subscribe(() => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); + const activationData = { + activatedOnDate: approveCurrentAccountFormData.approvedOnDate, + dateFormat, + locale + }; + this.currentAccountsService + .executeCurrentAccountCommand(this.accountId, 'activate', activationData) + .subscribe(() => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); + }); }); } } diff --git a/src/app/current-accounts/current-account-actions/current-account-actions.component.html b/src/app/current-accounts/current-account-actions/current-account-actions.component.html index b89775310..b1442a445 100644 --- a/src/app/current-accounts/current-account-actions/current-account-actions.component.html +++ b/src/app/current-accounts/current-account-actions/current-account-actions.component.html @@ -13,9 +13,7 @@ } @if (actions['Activate']) { - + } @if (actions['Undo Approval']) { diff --git a/src/app/current-accounts/current-account-stepper/current-account-digital-step/current-account-digital-step.component.html b/src/app/current-accounts/current-account-stepper/current-account-digital-step/current-account-digital-step.component.html index ae448a85a..f13275c06 100644 --- a/src/app/current-accounts/current-account-stepper/current-account-digital-step/current-account-digital-step.component.html +++ b/src/app/current-accounts/current-account-stepper/current-account-digital-step/current-account-digital-step.component.html @@ -15,7 +15,6 @@

Digital & Account Features

Toggle the facilities available for this account (as per RBI guidelines)

- FROM PRODUCT
diff --git a/src/app/current-accounts/current-account-stepper/current-account-digital-step/current-account-digital-step.component.ts b/src/app/current-accounts/current-account-stepper/current-account-digital-step/current-account-digital-step.component.ts index 6e5cc09d5..bcfb111da 100644 --- a/src/app/current-accounts/current-account-stepper/current-account-digital-step/current-account-digital-step.component.ts +++ b/src/app/current-accounts/current-account-stepper/current-account-digital-step/current-account-digital-step.component.ts @@ -52,12 +52,11 @@ export class CurrentAccountDigitalStepComponent { } } + // Note: a new account always starts with every digital facility off, even if the product has + // its own defaults configured -- those are enabled deliberately, one at a time, after the + // account is created and active, not inherited automatically at opening. @Input() - set currentAccountProductTemplate(value: any) { - if (!this.hasExistingAccount && value?.accountFacilityConfig) { - this.facilityConfig = { ...DEFAULT_FACILITY_CONFIG, ...value.accountFacilityConfig }; - } - } + currentAccountProductTemplate: any; get currentAccountDigital() { return { accountFacilityConfig: { ...this.facilityConfig } }; diff --git a/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.ts b/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.ts index dbddadaa1..0683c968d 100644 --- a/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.ts +++ b/src/app/current-accounts/current-account-stepper/current-account-preview-step/current-account-preview-step.component.ts @@ -136,12 +136,11 @@ export class CurrentAccountPreviewStepComponent implements OnChanges { return this.currentAccountSettingsForm?.getRawValue?.() || this.currentAccount || {}; } + /** Digital facility config as actually captured by a digital step in this wizard -- no fallback + * to the product's own defaults, since account creation no longer has a digital step at all and + * must not preview facilities the officer never actually chose. */ get digitalFacilityConfig(): any { - return ( - this.currentAccountDigital?.accountFacilityConfig ?? - this.currentAccountProductTemplate?.accountFacilityConfig ?? - null - ); + return this.currentAccountDigital?.accountFacilityConfig ?? null; } get hasDigitalSection(): boolean { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.html b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.html index 81998d8c9..5547c958e 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.html +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.html @@ -10,6 +10,7 @@ +

This approves and activates the account in one step -- it goes straight to Active.

{{ 'labels.inputs.Approved On Date' | translate }} diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts index a7ae6c9b2..a517f98b5 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts @@ -81,8 +81,9 @@ export class ApproveFixedDepositsAccountComponent implements OnInit { } /** - * Submits the form and approves the fixed deposit account, - * if successful redirects to the fixed deposit account. + * Submits the form, approves the fixed deposit account, then immediately activates it on the + * same date -- Approve and Activate are still two separate Fineract commands underneath (each + * shows up in the audit trail), but the officer only sees and clicks through one step. */ submit() { const approveFixedDepositsAccountFormData = this.approveFixedDepositsAccountForm.value; @@ -98,7 +99,16 @@ export class ApproveFixedDepositsAccountComponent implements OnInit { locale }; this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, 'approve', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); + const activationData = { + activatedOnDate: approveFixedDepositsAccountFormData.approvedOnDate, + dateFormat, + locale + }; + this.fixedDepositsService + .executeFixedDepositsAccountCommand(this.accountId, 'activate', activationData) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); }); } } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.html b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.html index 381399099..1519ff51f 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.html +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.html @@ -10,6 +10,7 @@ +

This approves and activates the account in one step -- it goes straight to Active.

{{ 'labels.inputs.Approved On Date' | translate }} diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts index 8dc8c427c..847aa80e5 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts @@ -81,8 +81,9 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit { } /** - * Submits the form and approves the recurring deposit account, - * if successful redirects to the recurring deposit account. + * Submits the form, approves the recurring deposit account, then immediately activates it on + * the same date -- Approve and Activate are still two separate Fineract commands underneath + * (each shows up in the audit trail), but the officer only sees and clicks through one step. */ submit() { const approveRecurringDepositsAccountFormData = this.approveRecurringDepositsAccountForm.value; @@ -103,7 +104,16 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit { this.recurringDepositsService .executeRecurringDepositsAccountCommand(this.accountId, 'approve', data) .subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); + const activationData = { + activatedOnDate: approveRecurringDepositsAccountFormData.approvedOnDate, + dateFormat, + locale + }; + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, 'activate', activationData) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); }); } } diff --git a/src/app/savings/create-savings-account/create-savings-account.component.html b/src/app/savings/create-savings-account/create-savings-account.component.html index 7bdf5abed..dfbf67e7c 100644 --- a/src/app/savings/create-savings-account/create-savings-account.component.html +++ b/src/app/savings/create-savings-account/create-savings-account.component.html @@ -12,9 +12,7 @@

Create Savings Account

-
- Pick a product, confirm currency, set digital channels and review before submit. -
+
Pick a product, confirm currency and review before submit.
@@ -76,33 +74,7 @@
- - - - - Digital - -
- @if (savingsAccountProductTemplate) { - - - } - -
- - - -
-
-
- - + diff --git a/src/app/savings/create-savings-account/create-savings-account.component.ts b/src/app/savings/create-savings-account/create-savings-account.component.ts index e5d7c2989..2ab7e094e 100644 --- a/src/app/savings/create-savings-account/create-savings-account.component.ts +++ b/src/app/savings/create-savings-account/create-savings-account.component.ts @@ -62,8 +62,8 @@ export class CreateSavingsAccountComponent { savingsAccountProductTemplate: any; /** Currently visible wizard tab (0-indexed). */ selectedTabIndex = 0; - /** Total wizard tabs — Product, Currency, Digital, Preview. */ - private readonly totalTabs = 4; + /** Total wizard tabs — Product, Currency, Preview. */ + private readonly totalTabs = 3; /** Guards against duplicate submissions from a double-click while the create request is in flight. */ submitting = false; diff --git a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.html b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.html index c38a3f304..3d92c8391 100644 --- a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.html +++ b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.html @@ -14,7 +14,9 @@

Activate Savings Account

-

Set the activation date and opening balance to bring this account live.

+

+ Set the activation date to bring this account live -- funding happens afterwards, as a separate deposit. +

@@ -45,18 +47,6 @@ } - - - Opening Balance - - ₹  - @if (minRequiredOpeningBalance) { - Minimum required: ₹{{ minRequiredOpeningBalance }} - } - @if (activateSavingsAccountForm.controls.openingBalance.hasError('min')) { - Opening balance must be at least ₹{{ minRequiredOpeningBalance ?? 0 }} - } -
diff --git a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts index e9add4f43..d7a41c94a 100644 --- a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts @@ -7,7 +7,7 @@ */ /** Angular Imports */ -import { Component, OnInit, Input, inject } from '@angular/core'; +import { Component, OnInit, inject } from '@angular/core'; import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { Dates } from 'app/core/utils/dates'; @@ -41,8 +41,6 @@ export class ActivateSavingsAccountComponent implements OnInit { private router = inject(Router); private settingsService = inject(SettingsService); - @Input() minRequiredOpeningBalance: number | null = null; - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -76,18 +74,10 @@ export class ActivateSavingsAccountComponent implements OnInit { * Creates the activate savings account form. */ createActivateSavingsAccountForm() { - const minBalance = this.minRequiredOpeningBalance ?? 0; this.activateSavingsAccountForm = this.formBuilder.group({ activatedOnDate: [ '', Validators.required - ], - openingBalance: [ - minBalance, - [ - Validators.required, - Validators.min(minBalance) - ] ] }); } @@ -109,9 +99,6 @@ export class ActivateSavingsAccountComponent implements OnInit { dateFormat, locale }; - if (data.openingBalance === 0 || data.openingBalance === null) { - delete data.openingBalance; - } this.savingsService.executeSavingsAccountCommand(this.accountId, 'activate', data).subscribe(() => { this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); diff --git a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.html b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.html index 8f61d900d..b6d897fb1 100644 --- a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.html +++ b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.html @@ -10,6 +10,7 @@ +

This approves and activates the account in one step -- it goes straight to Active.

{{ 'labels.inputs.Approved On Date' | translate }} diff --git a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts index 167f6cb2c..d1654136d 100644 --- a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts @@ -81,8 +81,9 @@ export class ApproveSavingsAccountComponent implements OnInit { } /** - * Submits the form and approves the saving account, - * if successful redirects to the saving account. + * Submits the form, approves the saving account, then immediately activates it on the same + * date -- Approve and Activate are still two separate Fineract commands underneath (each shows + * up in the audit trail), but the officer only sees and clicks through one step. */ submit() { const approveSavingsAccountFormData = this.approveSavingsAccountForm.value; @@ -98,7 +99,14 @@ export class ApproveSavingsAccountComponent implements OnInit { locale }; this.savingsService.executeSavingsAccountCommand(this.accountId, 'approve', data).subscribe(() => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); + const activationData = { + activatedOnDate: approveSavingsAccountFormData.approvedOnDate, + dateFormat, + locale + }; + this.savingsService.executeSavingsAccountCommand(this.accountId, 'activate', activationData).subscribe(() => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); + }); }); } } diff --git a/src/app/savings/saving-account-actions/saving-account-actions.component.html b/src/app/savings/saving-account-actions/saving-account-actions.component.html index 45d3df9ca..aaf4f6fc4 100644 --- a/src/app/savings/saving-account-actions/saving-account-actions.component.html +++ b/src/app/savings/saving-account-actions/saving-account-actions.component.html @@ -13,9 +13,7 @@ } @if (actions['Activate']) { - + } @if (actions['Undo Approval']) { diff --git a/src/app/savings/savings-account-stepper/savings-account-digital-step/savings-account-digital-step.component.html b/src/app/savings/savings-account-stepper/savings-account-digital-step/savings-account-digital-step.component.html index 5b0970996..8229ab305 100644 --- a/src/app/savings/savings-account-stepper/savings-account-digital-step/savings-account-digital-step.component.html +++ b/src/app/savings/savings-account-stepper/savings-account-digital-step/savings-account-digital-step.component.html @@ -15,7 +15,6 @@

Digital & Account Features

Toggle the facilities available for this account (as per RBI guidelines)

- FROM PRODUCT
diff --git a/src/app/savings/savings-account-stepper/savings-account-digital-step/savings-account-digital-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-digital-step/savings-account-digital-step.component.ts index 30da85e32..6add60514 100644 --- a/src/app/savings/savings-account-stepper/savings-account-digital-step/savings-account-digital-step.component.ts +++ b/src/app/savings/savings-account-stepper/savings-account-digital-step/savings-account-digital-step.component.ts @@ -50,12 +50,11 @@ export class SavingsAccountDigitalStepComponent { } } + // Note: a new account always starts with every digital facility off, even if the product has + // its own defaults configured -- those are enabled deliberately, one at a time, after the + // account is created and active, not inherited automatically at opening. @Input() - set savingsAccountProductTemplate(value: any) { - if (!this.hasExistingAccount && value?.accountFacilityConfig) { - this.facilityConfig = { ...DEFAULT_FACILITY_CONFIG, ...value.accountFacilityConfig }; - } - } + savingsAccountProductTemplate: any; get savingsAccountDigital() { return { accountFacilityConfig: { ...this.facilityConfig } }; diff --git a/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.ts index f8837abfc..32b227bcd 100644 --- a/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.ts +++ b/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.ts @@ -124,13 +124,11 @@ export class SavingsAccountPreviewStepComponent implements OnChanges { } } - /** Returns user-modified digital config (from digital step), falling back to product template */ + /** Digital facility config as actually captured by a digital step in this wizard -- no fallback + * to the product's own defaults, since account creation no longer has a digital step at all and + * must not preview facilities the officer never actually chose. */ get digitalFacilityConfig(): any { - return ( - this.savingsAccountDigital?.accountFacilityConfig ?? - this.savingsAccountProductTemplate?.accountFacilityConfig ?? - null - ); + return this.savingsAccountDigital?.accountFacilityConfig ?? null; } get hasDigitalSection(): boolean {