Files
cbsnexora/src/app/reports/sanctions-logs/sanctions-logs.component.ts
T
AdityaandClaude Opus 4.6 0a32d7135e feat: add Current Account module, DIP verification, charges integration, and translations
- Current Account module with full CRUD, transactions, charges, hold/release, block/unblock
- Current Products management under Products module
- DIP mobile number verification with real API call to /lookup/check
- Sanctions verification dialog
- Charges support for Current Account (chargeAppliesTo=5) in create/edit
- Fixed permissions from SAVINGSACCOUNT to CURRENTACCOUNT across all current account components
- Added all missing translation keys for Current Account in en-US.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 18:23:37 +05:30

116 lines
2.9 KiB
TypeScript

import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort, MatSortHeader } from '@angular/material/sort';
import {
MatTableDataSource,
MatTable,
MatColumnDef,
MatHeaderCellDef,
MatHeaderCell,
MatCellDef,
MatCell,
MatHeaderRowDef,
MatHeaderRow,
MatRowDef,
MatRow
} from '@angular/material/table';
import { MatChipsModule } from '@angular/material/chips';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatTooltip } from '@angular/material/tooltip';
import { NgClass, DatePipe } from '@angular/common';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
import { SanctionsLogsService } from './sanctions-logs.service';
@Component({
selector: 'mifosx-sanctions-logs',
templateUrl: './sanctions-logs.component.html',
styleUrls: ['./sanctions-logs.component.scss'],
imports: [
...STANDALONE_SHARED_IMPORTS,
MatTable,
MatSort,
MatColumnDef,
MatHeaderCellDef,
MatHeaderCell,
MatSortHeader,
MatCellDef,
MatCell,
MatHeaderRowDef,
MatHeaderRow,
MatRowDef,
MatRow,
MatPaginator,
MatChipsModule,
MatProgressBarModule,
MatTooltip,
NgClass,
DatePipe,
FaIconComponent
]
})
export class SanctionsLogsComponent implements OnInit {
private sanctionsLogsService = inject(SanctionsLogsService);
displayedColumns: string[] = [
'screenedName',
'screeningResult',
'matchCount',
'screenedBy',
'screenedAt'
];
dataSource = new MatTableDataSource<any>();
searchName = '';
activeFilter: string | null = null;
loading = false;
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
@ViewChild(MatSort, { static: true }) sort: MatSort;
ngOnInit() {
this.loadLogs();
}
loadLogs() {
this.loading = true;
const filters: any = {};
if (this.activeFilter) {
filters.result = this.activeFilter;
}
if (this.searchName?.trim()) {
filters.name = this.searchName.trim();
}
this.sanctionsLogsService.getLogs(filters).subscribe({
next: (data: any) => {
this.dataSource = new MatTableDataSource(data || []);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.loading = false;
},
error: () => {
this.dataSource = new MatTableDataSource([]);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.loading = false;
}
});
}
applySearch(value: string) {
this.searchName = value;
this.loadLogs();
}
filterByResult(result: string | null) {
this.activeFilter = this.activeFilter === result ? null : result;
this.loadLogs();
}
clearFilters() {
this.searchName = '';
this.activeFilter = null;
this.loadLogs();
}
}