/**
 * Interfaces para o sistema de filtros dinâmicos
 */

export interface SpecialFilter {
  id: string;
  label: string;
  type: 'date-range' | 'number-range' | 'custom-select' | 'multi-search';
  required?: boolean;
  defaultValue?: any;
  config?: any;
}

export interface DefaultFilter {
  field: string;
  operator: 'in' | 'eq' | 'like' | 'between' | 'gte' | 'lte';
  value: any;
}

export interface FilterConfig {
  specialFilters?: SpecialFilter[];
  defaultFilters?: DefaultFilter[];
  companyFilter?: boolean; // default: true
  dateRangeFilter?: boolean; // default: true - Filtro de período (date_start/date_end)
  
  // ✨ NOVOS: Campos customizáveis para filtros de data
  dateFieldNames?: {
    startField: string;
    endField: string;
  };
  
  // ✨ NOVOS: Filtros de data de vencimento
  dueDateOneFilter?: boolean; // default: false - Filtro de data de vencimento 1
  dueDateOneFieldNames?: {
    label?: string;      // ✨ NOVO: Label customizado (default: 'Data de Vencimento 1')
    startField: string;
    endField: string;
  };
  
  dueDateTwoFilter?: boolean; // default: false - Filtro de data de vencimento 2
  dueDateTwoFieldNames?: {
    label?: string;      // ✨ NOVO: Label customizado (default: 'Data de Vencimento 2')
    startField: string;
    endField: string;
  };
}

export interface RawFilters {
  [key: string]: any;
}

export interface ProcessedFilter {
  type: 'simple' | 'date-range' | 'number-range' | 'multi-select' | 'range';
  value?: any;
  start?: any;
  end?: any;
  min?: any;
  max?: any;
  operator?: 'in' | 'eq' | 'like' | 'between' | 'gte' | 'lte'; // ✅ NOVO: Operador para defaultFilters
}

export interface ProcessedFilters {
  [key: string]: ProcessedFilter;
}

export interface ApiFilters {
  [key: string]: any;
}

export interface Option {
  value: any;
  label: string;
  disabled?: boolean;
} 