export interface BaseEntity {
  id: string;
  createdAt?: string;
  updatedAt?: string;
}

export interface PaginatedResponse<T> {
  items: T[];
  total: number;
  page: number;
  page_size: number;
  pages: number;
}

export interface ApiResponse<T> {
  success: boolean;
  message?: string;
  data?: T;
  error?: string;
}

export interface PaginationParams {
  page: number;
  size: number;
  search?: string;
}

export interface UseEntityHookReturn<T, TCreate = unknown, TUpdate = unknown> {
  items: T[];
  selectedItem: T | null;
  error: string | null;
  isLoading: boolean;
  loadingSingle: boolean;
  currentPage: number;
  totalCount: number;
  pageSize: number;
  searchTerm: string;
  totalPages: number;
  fetchItems: (page?: number, size?: number, search?: string, filters?: Record<string, any>) => Promise<void>;
  createItem: (data: TCreate) => Promise<boolean>;
  updateItem: (id: string, data: TUpdate) => Promise<boolean>;
  deleteItem: (id: string) => Promise<boolean>;
  fetchItemById: (id: string) => Promise<void>;
  setSearchTerm: (term: string) => void;
  setCurrentPage: (page: number) => void;
  setPageSize: (size: number) => void;
  setSelectedItem: (item: T | null) => void;
  setIsLoading: (value: boolean) => void;
  setError: (value: string | null) => void;
  setItems: (items: T[]) => void;
  setTotalCount: (count: number) => void;
  setTotalPages: (pages: number) => void;
}

export interface FormField {
  name: string;
  label: string;
  type: 'text' | 'email' | 'password' | 'number' | 'textarea' | 'select' | 'file' | 'date';
  required?: boolean;
  placeholder?: string;
  options?: { value: string | number; label: string }[];
  accept?: string;
}