import { BaseApiTemplateService, ConditionalCriterion, EntityContainerModel } from 'blg-akaun-ts-lib'; import { IDropDownOptions } from '../../models/drop-down-option.model'; export declare abstract class EntityContanerModel implements IDropDownOptions { service: BaseApiTemplateService; placeholder: string; constructor(service: BaseApiTemplateService, placeholder: string); label: string; labelRenderer(container: EntityContainerModel): string; guidSelector(container: EntityContainerModel): import("blg-akaun-ts-lib").GuidDataFieldInterface; abstract searchCriteria(searchText: string): ConditionalCriterion[]; } export declare class SupplierDropDown extends EntityContanerModel { label: string; /** * 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 ('SUPPLIER_CODE','EMP_SUPPLIER_CODE') * OR (ext.param_code = 'AKN_ETY_CTG' AND ext.value_string = 'SUPPLIER')) * AND ((ext.param_code = 'SUPPLIER_CODE' AND ext.value_string ILIKE '%x%') * OR hdr.name ILIKE '%x%') * ORDER BY hdr.name * * This options object is used with SupplierService, whose endpoint is * entity/suppliers; EntityController sets is_supplier = true from that path * segment, so the "is a supplier" scoping the ext join expressed is applied by * the endpoint itself. EntityUow.whereClauseCriteriaForSnapshot (the method * behind GET entity/suppliers/query) then applies: * - search_word -> EntityUowHelper.generateSearchWordCondition, which, with * is_supplier set, ILIKEs hdr.supplier_code alongside name, id_no, * nickname, descr, phone, email, website_url, tax_reg_number, ... * - status -> EntityUowHelper.whereClauseHdr (`hdr.status = 'ACTIVE'`). * * Behaviour notes: * - The keyword now also matches phone/email/id_no/etc., not just supplier code * and name, so the typeahead is broader than before. * - Entities recognised as a supplier only through the legacy extension rows (a * `SUPPLIER_CODE` / `EMP_SUPPLIER_CODE` row, or `AKN_ETY_CTG = 'SUPPLIER'`) * rather than through hdr.is_supplier are kept by the `legacy_entity_category` * criterion, which makes EntityUowHelper.whereClauseHdr OR the same extension * test onto the is_supplier condition. Without it those entities would drop out * of the dropdown, because the endpoint derives is_supplier 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. * - ORDER BY hdr.name is expressed through the sort criteria in the base class, * which orders by the endpoint default; see DropDownComponent.searchEntity. */ searchCriteria(searchText: string): ConditionalCriterion[]; }