/* eslint-disable @typescript-eslint/no-explicit-any */ import { FilterTargetType, Operator, OperatorCreiteria } from "../../enum"; import { ValueLoadType } from "../../type"; export type AdvancedSearchData = { appliedQuery: { criteria: string; filters: FilterExpression[] }; filterRows: FilterExpressionViewModel[]; criteria: string; }; export type FilterExpression = { id: string; propertyToFilter: FilterTarget; operator: { label: string; value: Operator | null }; value?: FilterValue | FilterValue[]; selectedCriteria: OperatorCreiteria; }; export type FilterTarget = { label: string; value: any; apiPropertyName: string; /** * Where the value cell's options come from, for the types that present a * choice — LIST (dropdown / multiselect) and BOOLEAN (radio group). `SELF` * carries the `{label, value}` pairs inline, `API` names the supportive-data * `key` to fetch them under. A BOOLEAN field that omits this keeps the * built-in True/False pair. */ dataProvider?: { key?: string; value?: FilterValue | FilterValue[]; valueLoadType: ValueLoadType; }; type: FilterTargetType; /** * How the value should be *presented*, when `type` alone is ambiguous. A * money field and a plain count are both NUMBER; only the field knows which * it is. The symbol itself is NOT declared here — that is per-org and comes * from the host's registered localization resolver (`utils/localization`). */ valueFormat?: "CURRENCY"; }; export type FilterValue = | { label: string; value: any } | string | number | Date | boolean; export type FilterExpressionViewModel = { id: string; idLabel: string; allPropertieseToFilter: FilterTarget[]; alloperators: { label: string; value: Operator | null }[]; allValues?: FilterValue[] | FilterValue; selectedFilter: FilterExpression; };