import { EventEmitter, OnDestroy, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; import { ApiVisa, CustomerService, EntityContainerModel } from 'blg-akaun-ts-lib'; import { ReplaySubject, Subject } from 'rxjs'; export declare class SelectCustomerDropDownComponent implements OnInit, OnDestroy { private customerService; customer: FormControl; apiVisa: ApiVisa; required: boolean; customerChange: EventEmitter; customerSelected: EventEmitter; serverSideFiltering: FormControl; serverSideSearching: boolean; filteredOptions$: ReplaySubject; customerList: EntityContainerModel[]; selectedCustomer: EntityContainerModel; protected _onDestroy: Subject; constructor(customerService: CustomerService); ngOnInit(): void; /** * Server-side customer typeahead. * * Replaces the raw SELECT that went through SubQueryService: * * FROM bl_fi_mst_entity_ext ext LEFT JOIN bl_fi_mst_entity_hdr hdr * WHERE hdr.status = 'ACTIVE' * AND (ext.param_code IN ('CUSTOMER_CODE','EMP_CUSTOMER_CODE') * OR (ext.param_code = 'AKN_ETY_CTG' AND ext.value_string = 'CUSTOMER')) * AND ((ext.param_code = 'CUSTOMER_CODE' AND ext.value_string ILIKE '%x%') * OR hdr.name ILIKE '%x%') * ORDER BY hdr.name * * CustomerService points at entity/customers, and EntityController sets * is_customer = true from that path segment, so the "is a customer" scoping the * ext join expressed is applied by the endpoint. EntityUow's * whereClauseCriteriaForSnapshot (the method behind GET entity/customers/query) * then applies `search_word` through EntityUowHelper.generateSearchWordCondition * -- with is_customer set that ILIKEs hdr.customer_code alongside name, id_no, * nickname, descr, phone, email, ... -- and `status` through * EntityUowHelper.whereClauseHdr. * * Behaviour notes: * - The keyword now also matches phone/email/id_no/etc., so the typeahead is * broader than the old customer-code/name pair. * - Entities recognised as a customer only through the legacy extension rows (a * `CUSTOMER_CODE` / `EMP_CUSTOMER_CODE` row, or `AKN_ETY_CTG = 'CUSTOMER'`) * rather than through hdr.is_customer are kept by the `legacy_entity_category` * criterion, which makes EntityUowHelper.whereClauseHdr OR the same extension * test onto the is_customer condition. Without it those entities would drop out * of the dropdown, because the endpoint derives is_customer from the path. * It costs a correlated subquery per request: once * `entity-category-flag-check.sql` reports a zero gap for every tenant, the flag * is backfilled and this criterion can be dropped. * - One request instead of one subquery plus one getByCriteria per hit; the * `catchError` that swallowed per-guid CORS failures is no longer needed * because there is only one request, whose error path the caller handles. */ searchCustomer(searchText: string): import("rxjs").Observable; onSelect(entityGuid: string): void; ngOnDestroy(): void; }