export type TableName =
  | 'anticipos'
  | 'asistencias'
  | 'carretas'
  | 'clientes'
  | 'comercios'
  | 'cupones'
  | 'depositos'
  | 'ingresos'
  | 'pagos_anticipo'
  | 'rechazos'
  | 'tareas_realizadas'

export type TableTransform = {
  readonly serializeRow?: (row: Record<string, unknown>) => Record<string, unknown>
}

export interface TableConfig {
  readonly table: TableName
  readonly primaryKey?: string
  readonly defaultSelect?: string
  readonly transforms?: TableTransform
}

export interface QueryFilter {
  field: string
  operator?: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike'
  value: string | number | boolean
}

export interface ParsedQuery {
  filters: QueryFilter[]
  limit?: number
  offset?: number
  orderBy?: { field: string; ascending?: boolean }
}
