export interface Integration {
  id: number;
  uuid: string;
  type: string;
  params: Record<string, any>;
  cache: Record<string, any> | null;
  isEnabled: boolean;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
}

// ========================================
// 🎯 NOVA INTERFACE PARA RESPOSTA PAGINADA DA API
// ========================================
export interface PaginatedResponse<T> {
  data: T[];
  isFirstPage: boolean;
  isLastPage: boolean;
  currentPage: number;
  previousPage: number | null;
  nextPage: number | null;
  pageCount: number;
  totalCount: number;
}

export interface IntegrationResponse {
  data: Integration[];
  total: number;
  limit: number;
  page: number;
}

export interface IntegrationDetails extends Integration {
  description?: string;
  lastSync?: string;
  status?: IntegrationStatus;
  category?: IntegrationCategory;
}

export enum IntegrationStatus {
  CONNECTED = 'connected',
  ERROR = 'error',
  DISCONNECTED = 'disconnected'
}

export enum IntegrationCategory {
  ALL = 'all',
  CADASTROS = 'cadastros',
  RASTREADORES = 'rastreadores',
  COMBUSTIVEIS = 'combustiveis',
  DMS = 'dms',
  TMS = 'tms',
  ERP = 'erp',
  RPA = 'rpa',
  RMS = 'rms'
}

export interface IntegrationFilter {
  search?: string;
  status?: IntegrationStatus | 'all';
  category?: IntegrationCategory;
  isEnabled?: boolean;
}

export interface ReconnectData {
  apiKey: string;
  endpoint?: string;
}

// Interface genérica para cards reutilizáveis
export interface GenericCard {
  id: number | string;
  title: string;
  description: string;
  status: 'connected' | 'error' | 'disconnected' | 'active' | 'inactive';
  statusLabel: string;
  iconClass?: string;
  category?: string;
  actions: CardAction[];
}

export interface CardAction {
  label: string;
  action: string;
  type: 'primary' | 'secondary' | 'danger' | 'connect';
  icon?: string;
} 