import type { DataFormat } from '../constants/data-format'; import type { DataType } from '../constants/data-type'; import type { FilterFieldType } from '../constants/filter-field-type'; import type { FilterType } from '../constants/filter-type'; import type { ReportGroupName } from '../constants/report-group'; export interface ReportColumnConfigEntity { column: string; query: string; label: string; type: DataType; format: DataFormat; dateFormat?: string; } export interface FilterConfigEntity { filterColumn: string; filterType: FilterType; fieldType: FilterFieldType; fieldLabel: string; hideField?: boolean; selectDataSourceUrl?: string; selectCustomOptions?: string[]; selectValueKey?: string; selectLabelKey?: string; dateFormat?: string; } export interface FilterPeriodConfig { hidden?: boolean; } export interface FilterModelEntry { type: FilterType; filter: unknown; } export interface ReportConfigEntity { groupName: ReportGroupName; uniqueName: string; privilegeKey: string; label: string; tableSchema: string; mainTableAlias?: string; columnConfigs: ReportColumnConfigEntity[]; filterConfigs?: FilterConfigEntity[]; filterPeriodConfig?: FilterPeriodConfig; whereDefaultConditions?: string[]; whereCondition?: (filterModel: Record) => string[]; ignoreFilterKeys?: string[]; customQueryColumn?: (column: string) => string | undefined; defaultOrderBy?: string[]; lowLevelOrderBy?: string[]; } export interface ReportConfigPublicEntity extends Omit< ReportConfigEntity, 'whereCondition' | 'customQueryColumn' > {} export interface RowGroupColEntity { id: string; displayName: string; field: string; } export interface ValueColEntity { id: string; field: string; aggFunc: string; } export interface SortModelEntry { colId: string; sort: 'asc' | 'desc'; } export interface QueryModelEntity { startRow: number; endRow: number; rowGroupCols: RowGroupColEntity[]; valueCols: ValueColEntity[]; pivotCols: unknown[]; pivotMode: boolean; groupKeys: unknown[]; filterModel: Record; sortModel: SortModelEntry[]; } export const COUNT_CHILD_GROUP_COLUMN = 'countChildGroup';