/** * 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 { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; import { MatButtonModule } from '@angular/material/button'; import { VerificationCheck } from '../../loan-origination-data'; export interface FieldVisitPhoto { file: File; previewUrl: string | null; } export interface FieldVisitDetailsDialogData { label: string; check: VerificationCheck; photos: FieldVisitPhoto[]; } /** * Everything saved for one Field Investigation address visit -- officer, assignment date, GPS, * status/remarks and every site photo -- in one popup, since the inline card only ever shows a * short summary once the visit is Verified/Failed. Photos are local-only File objects (same as * every other document capture in this mock pipeline), so a photo count with no files behind it * just means the page was refreshed since the visit was captured, not that anything was lost from * the application record itself. */ @Component({ selector: 'mifosx-field-visit-details-dialog', standalone: true, imports: [ CommonModule, MatDialogModule, MatButtonModule ], templateUrl: './field-visit-details-dialog.component.html', styleUrls: ['./field-visit-details-dialog.component.scss'] }) export class FieldVisitDetailsDialogComponent { data = inject(MAT_DIALOG_DATA); get statusBadgeClass(): string { if (this.data.check.status === 'VERIFIED') { return 'fvd-badge fvd-badge--verified'; } if (this.data.check.status === 'FAILED') { return 'fvd-badge fvd-badge--failed'; } return 'fvd-badge fvd-badge--pending'; } }