Files
cbsnexora/src/app/digital/sender-history-dialog/sender-history-dialog.component.ts
T
AdityaandClaude Opus 4.7 325228c514 feat: letter-mgmt module + digital UPI/IMPS/ATM-POS reports + header redesign
letter-mgmt (new module):
- Notice page: overdue loan list with filters, KPI strip, bulk actions,
  call disposition logging (Promise-to-Pay, Not Reachable, etc.), Speed
  Post dispatch dialog with consignment + post-office tracking,
  PDF preview + download, call-contact dialog with primary / alt /
  family / nominee numbers and per-contact disposition history.
- Certificates: Loan Interest, Share, Balance, Form 60 (no-PAN flow),
  Form 15G/H (auto age-based), Hypothecation, NOC - each with shared
  preview dialog (six tone variants) and jsPDF generator using a
  common letterhead / summary-grid / signature-seal helper.

digital:
- IMPS module: report (P2A/P2P/Aadhaar tabs) + entry form with
  MMID/mobile lookup, NPCI switch resolve-to-A/C+IFSC BANL flow,
  sender autocomplete, hide sender field for P2P/Aadhaar, charges +
  18% GST + waive checkbox, per-sender today-only history dialog.
- UPI report with app-mix tab and full transaction filtering.
- ATM/POS/ECOM hub with three ticket cards routing to today/status/cycle.
- NEFT/RTGS entry: sender-account autocomplete, charges + GST + waive,
  field reorder (sender before amount), NEFT cap / RTGS floor
  validation, History button opening per-sender today's transactions.
- NEFT/RTGS report: horizontal-bar trend leaderboard replacing tall bars.

shell + theme:
- Header redesigned with IBM Plex Sans 12/500 typography, 11-column grid
  per row, top-accent hover indicator, bordered cells via grid-gap.
- Live KPI ticker below menu (CASH, TXN TODAY, CLEARING IN/OUT, NPA,
  CASA, CD RATIO, RBI CIRC, REPO) with marquee scroll, pause-on-hover,
  brand-blue gradient, amber bottom strip, pulsing red LIVE chip.
- Sidebar 'KYC Management' -> 'KYC & ReKYC Management'.
- Letter Mgmt / certificate menu items wired with green icon hints for
  items that have a working page.

access-control:
- MFA card layout compacted; method header inlines back button + title.

icons:
- Register faTruck/TruckFast, faEllipsisV/H, faCommentDots.
- Add IBM Plex Sans Google Fonts import to index.html.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 10:09:06 +05:30

114 lines
3.7 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 { CommonModule } from '@angular/common';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { MatTooltip } from '@angular/material/tooltip';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
import { NeftRtgsTxn, ProcessingState } from '../neft-rtgs-report/neft-rtgs-report.component';
export interface SenderHistoryDialogData {
/** Sender's name as shown on the sender chip. */
senderName: string;
/** Picked sender account number (for exact-match filtering). */
senderAccountNo: string;
/** Full transaction history to filter (already-seeded mock or live API rows). */
txns: NeftRtgsTxn[];
}
@Component({
selector: 'mifosx-sender-history-dialog',
templateUrl: './sender-history-dialog.component.html',
styleUrls: ['./sender-history-dialog.component.scss'],
imports: [
...STANDALONE_SHARED_IMPORTS,
CommonModule,
FaIconComponent,
MatTooltip
]
})
export class SenderHistoryDialogComponent {
private dialogRef = inject(MatDialogRef<SenderHistoryDialogComponent>);
data: SenderHistoryDialogData = inject(MAT_DIALOG_DATA);
/** Today's date as YYYY-MM-DD — matches the `valueDate` shape in the txn seed. */
private get todayKey(): string {
const d = new Date();
const pad = (n: number) => String(n).padStart(2, '0');
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
}
/**
* Today's NEFT/RTGS rows for this sender — matched by exact A/C number when
* available, otherwise by case-insensitive holder name (since the demo seed
* and operator account list don't share account numbers). Older value dates
* are excluded; this view is intentionally a today-only snapshot.
*/
get filteredTxns(): NeftRtgsTxn[] {
const acc = (this.data.senderAccountNo || '').trim().toLowerCase();
const name = (this.data.senderName || '').trim().toLowerCase();
const today = this.todayKey;
return (this.data.txns || []).filter((t) => {
if (t.valueDate !== today) return false;
if (acc && t.remitterAcc.toLowerCase() === acc) return true;
if (name && t.remitterUser.toLowerCase() === name) return true;
return false;
});
}
// ─── KPI getters ───
get totalCount(): number {
return this.filteredTxns.length;
}
get totalAmount(): number {
return this.filteredTxns.reduce((s, t) => s + t.amount, 0);
}
get settledCount(): number {
return this.filteredTxns.filter((t) => t.processingState === 'SETTLED').length;
}
get pendingCount(): number {
return this.filteredTxns.filter((t) => [
'UPLOADED',
'VALIDATED',
'SENT',
'PENDING'
].includes(t.processingState)).length;
}
get returnedCount(): number {
return this.filteredTxns.filter((t) => t.processingState === 'RETURNED').length;
}
get successRate(): number {
if (this.totalCount === 0) return 0;
return (this.settledCount / this.totalCount) * 100;
}
stateColor(state: ProcessingState): string {
switch (state) {
case 'SETTLED':
return 'green';
case 'RETURNED':
return 'red';
case 'SENT':
return 'blue';
case 'VALIDATED':
return 'teal';
case 'UPLOADED':
return 'amber';
case 'PENDING':
return 'amber';
}
}
close(): void {
this.dialogRef.close();
}
}