Files
cbsnexora/src/app/cfcfrms/cfcfrms.service.ts
T
AdityaandClaude Opus 4.6 b3a4cce0cf feat: add CFCFRMS module, bank menus, mock backend, and dashboard redesign
- CFCFRMS cyber fraud complaint management with dashboard, complaints,
  escalation, report suspect/mule/fraud txn, FMR submission, CFR lookup
- Mock HTTP interceptor with 20 dummy complaints and all endpoints
- Simulator service for I4C/MHA integration testing
- 3-row menu bar with 22 items (7+8+8 layout)
- Mega menus for General Ledger, Sub Ledger, Deposits, Share, Others,
  HRM, RBI with search and grouped columns
- Dropdowns for Cashier, Clearing, NPA, CKYC, Advances, Letter Mgmt,
  Insurance, Digital
- Dashboard redesign with regulatory, financial health, deposits,
  risk/NPA sections using static banking data
- All translations added to en-US.json
- FontAwesome icons registered for all new menu items

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

110 lines
4.0 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 { Injectable, inject } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import {
Complaint,
ComplaintAction,
DashboardStats,
TimelineEvent,
PagedResponse,
EscalationRequest,
EscalationResponse,
ReportSuspectRequest,
ReportSuspectResponse,
ReportMuleAccountRequest,
ReportMuleAccountResponse,
ReportFraudTransactionRequest,
ReportFraudTransactionResponse,
FmrSubmissionRequest,
FmrSubmissionResponse,
CfrLookupResponse
} from './models/cfcfrms.models';
import { environment } from '../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class CfcfrmsService {
private http = inject(HttpClient);
private baseUrl = environment.cfcfrmsApiUrl || `${environment.serverUrl}/cfcfrms`;
createComplaint(complaint: Partial<Complaint>): Observable<Complaint> {
return this.http.post<Complaint>(`${this.baseUrl}/complaints`, complaint);
}
getComplaints(params?: {
page?: number;
size?: number;
status?: string;
search?: string;
dateFrom?: string;
dateTo?: string;
}): Observable<PagedResponse<Complaint>> {
let httpParams = new HttpParams();
if (params) {
if (params.page != null) httpParams = httpParams.set('page', params.page.toString());
if (params.size != null) httpParams = httpParams.set('size', params.size.toString());
if (params.status) httpParams = httpParams.set('status', params.status);
if (params.search) httpParams = httpParams.set('search', params.search);
if (params.dateFrom) httpParams = httpParams.set('dateFrom', params.dateFrom);
if (params.dateTo) httpParams = httpParams.set('dateTo', params.dateTo);
}
return this.http.get<PagedResponse<Complaint>>(`${this.baseUrl}/complaints`, { params: httpParams });
}
getComplaintById(ticketId: string): Observable<Complaint> {
return this.http.get<Complaint>(`${this.baseUrl}/complaints/${ticketId}`);
}
submitAction(ticketId: string, actionPayload: ComplaintAction): Observable<Complaint> {
return this.http.put<Complaint>(`${this.baseUrl}/complaints/${ticketId}/action`, actionPayload);
}
getStats(): Observable<DashboardStats> {
return this.http.get<DashboardStats>(`${this.baseUrl}/complaints/stats`);
}
getTimeline(ticketId: string): Observable<TimelineEvent[]> {
return this.http.get<TimelineEvent[]>(`${this.baseUrl}/complaints/${ticketId}/timeline`);
}
escalateComplaint(ticketId: string, payload: EscalationRequest): Observable<EscalationResponse> {
return this.http.post<EscalationResponse>(`${this.baseUrl}/complaints/${ticketId}/escalate`, payload);
}
// ─── Bank Proactive Reporting ───
reportSuspect(payload: ReportSuspectRequest): Observable<ReportSuspectResponse> {
return this.http.post<ReportSuspectResponse>(`${this.baseUrl}/report-suspect`, payload);
}
reportMuleAccount(payload: ReportMuleAccountRequest): Observable<ReportMuleAccountResponse> {
return this.http.post<ReportMuleAccountResponse>(`${this.baseUrl}/report-mule-account`, payload);
}
reportFraudTransaction(payload: ReportFraudTransactionRequest): Observable<ReportFraudTransactionResponse> {
return this.http.post<ReportFraudTransactionResponse>(`${this.baseUrl}/report-fraud-transaction`, payload);
}
// ─── RBI Integration ───
private rbiBaseUrl = `${environment.serverUrl}/rbi`;
submitFmr(payload: FmrSubmissionRequest): Observable<FmrSubmissionResponse> {
return this.http.post<FmrSubmissionResponse>(`${this.rbiBaseUrl}/fmr`, payload);
}
lookupCfr(accountNumber: string): Observable<CfrLookupResponse> {
const params = new HttpParams().set('accountNumber', accountNumber);
return this.http.get<CfrLookupResponse>(`${this.rbiBaseUrl}/cfr/lookup`, { params });
}
}