/** * 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, OnInit, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { HttpClient, HttpParams } from '@angular/common/http'; import { FormsModule, ReactiveFormsModule, FormBuilder, FormGroup } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; export interface CustomerSearchResult { clientId: number; displayName: string; mobileNo: string | null; officeName: string | null; accountNo: string | null; accountType: 'SAVINGS' | 'CURRENT' | 'FIXED_DEPOSIT' | 'RECURRING_DEPOSIT' | null; panNumber: string | null; aadhaarNumber: string | null; address: string | null; } /** Optional data for the dialog. */ export interface CustomerSearchDialogData { /** * Whether a customer must have an account to be picked. True by default, because the account screens * need one; a screen that only needs the customer (cash exchange) passes false. */ requireAccount?: boolean; } type AccountTypeKey = 'savings' | 'current' | 'fixedDeposit' | 'recurringDeposit'; @Component({ selector: 'mifosx-customer-search-dialog', standalone: true, imports: [ CommonModule, FormsModule, ReactiveFormsModule, MatDialogModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, MatProgressBarModule, MatSnackBarModule ], template: `
Fill in any one field, or combine several to narrow the search (e.g. name + account number).