/** * 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 { MatSnackBar } from '@angular/material/snack-bar'; import { MatTooltip } from '@angular/material/tooltip'; import { Router } from '@angular/router'; import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module'; export type AtmPosEcomReportKind = 'today' | 'status' | 'cycle'; interface ReportTicket { kind: AtmPosEcomReportKind; /** Route segment under /digital/atm-pos-ecom/ — wired once the report component exists. */ route: string; icon: string; accent: 'blue' | 'green' | 'purple'; title: string; tagline: string; description: string; cta: string; } @Component({ selector: 'mifosx-atm-pos-ecom', templateUrl: './atm-pos-ecom.component.html', styleUrls: ['./atm-pos-ecom.component.scss'], imports: [ ...STANDALONE_SHARED_IMPORTS, CommonModule, FaIconComponent, MatTooltip ] }) export class AtmPosEcomComponent { private snack = inject(MatSnackBar); private router = inject(Router); /** The three reports surfaced as tickets. Wire `route` to a real component as it lands. */ readonly tickets: ReportTicket[] = [ { kind: 'today', route: 'today', icon: 'calendar-check', accent: 'blue', title: "Today's Report", tagline: 'Same-day snapshot', description: "Real-time view of today's ATM, POS and E-commerce transactions across every channel — counts, value, success rate.", cta: 'Open Today’s Report' }, { kind: 'status', route: 'status', icon: 'tasks', accent: 'green', title: 'Status-wise Report', tagline: 'Grouped by processing state', description: 'Breakdown by outcome — Approved · Declined · Reversed · Pending · Timed-out. Useful for ops triage and decline-rate analysis.', cta: 'Open Status Report' }, { kind: 'cycle', route: 'cycle', icon: 'sync-alt', accent: 'purple', title: 'Cycle-wise Report', tagline: 'Per settlement cycle', description: 'Compare across settlement cycles — daily, weekly, monthly — for reconciliation with the network and acquirer files.', cta: 'Open Cycle Report' } ]; /** * Until the underlying report components are wired, clicks surface a friendly * "coming soon" toast. Once the report format is shared, replace this with * `this.router.navigate(['/digital/atm-pos-ecom', t.route])`. */ openReport(t: ReportTicket): void { this.snack.open(`${t.title} is coming next — drop the format and I'll wire it up.`, 'OK', { duration: 3500 }); // this.router.navigate(['/digital/atm-pos-ecom', t.route]); } }