Files
cbsnexora/src/app/savings/saving-account-actions/savings-account-transactions/transaction-confirm-dialog/transaction-confirm-dialog.component.ts
T
AdityaandClaude Opus 4.7 b149fef72e feat: KYC re-verify UX, family/nominee tab gating, savings dialogs, cfcfrms shell
- KYC tab: fix Verify (PAN) and Send OTP (Aadhaar) being disabled in edit mode;
  unmask Aadhaar input and show on-file masked value as hint; resolve kycId
  from id/kycId/resourceId fallbacks.
- Client stepper/view: add familyAllowed / nomineeAllowed predicates +
  CanActivate route guards. Family tab hidden for non-individuals, Nominee
  tab hidden for non-proprietor entities. Family-members step accepts a
  nomineeOnly input for proprietorship clients. Add/Edit/Delete buttons
  inside family-members and nominee tabs gated by canAdd.
- cfcfrms: add cfcfrms-shell wrapper, restyle complaint/fraud/mule/escalate
  pages and dashboard.
- Savings: identity-verify and transaction-confirm dialogs, manage / activate
  / add-charge flows, account preview styling.
- Tasks, core shell, account-nominees, icons: minor style and behaviour
  updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:49:43 +05:30

76 lines
2.1 KiB
TypeScript

/**
* 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, inject } from '@angular/core';
import {
MatDialogRef,
MAT_DIALOG_DATA,
MatDialogContent,
MatDialogActions,
MatDialogClose
} from '@angular/material/dialog';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
export interface TransactionConfirmData {
/** 'deposit' | 'withdrawal' — drives the colour palette + sign. */
kind: 'deposit' | 'withdrawal';
clientName: string | null;
accountNo: string | null;
currentBalance: number;
transactionAmount: number;
paymentTypeLabel: string | null;
}
/**
* Pre-commit confirmation pop-up showing the cashier exactly how the
* deposit / withdrawal will affect the account: current balance, the
* transaction amount, and the post-transaction balance.
*/
@Component({
selector: 'mifosx-transaction-confirm-dialog',
standalone: true,
templateUrl: './transaction-confirm-dialog.component.html',
styleUrls: ['./transaction-confirm-dialog.component.scss'],
imports: [
...STANDALONE_SHARED_IMPORTS,
MatDialogContent,
MatDialogActions,
MatDialogClose,
FaIconComponent
]
})
export class TransactionConfirmDialogComponent {
dialogRef = inject<MatDialogRef<TransactionConfirmDialogComponent>>(MatDialogRef);
data = inject<TransactionConfirmData>(MAT_DIALOG_DATA);
get isDeposit(): boolean {
return this.data.kind === 'deposit';
}
get signedAmount(): number {
return this.isDeposit ? this.data.transactionAmount : -this.data.transactionAmount;
}
get newBalance(): number {
return this.data.currentBalance + this.signedAmount;
}
get overdraft(): boolean {
return !this.isDeposit && this.newBalance < 0;
}
confirm(): void {
this.dialogRef.close({ confirm: true });
}
cancel(): void {
this.dialogRef.close({ confirm: false });
}
}