import { EntityType } from '../types/CalendarTypes';

/**
 * IApiRepository<T> - Generic interface for backend API communication
 *
 * Used by DataSeeder to fetch initial data and by SyncManager for sync operations.
 */
export interface IApiRepository<T> {
  /**
   * Entity type discriminator - used for runtime routing
   */
  readonly entityType: EntityType;

  /**
   * Send create operation to backend API
   */
  sendCreate(data: T): Promise<T>;

  /**
   * Send update operation to backend API
   */
  sendUpdate(id: string, updates: Partial<T>): Promise<T>;

  /**
   * Send delete operation to backend API
   */
  sendDelete(id: string): Promise<void>;

  /**
   * Fetch all entities from backend API
   */
  fetchAll(): Promise<T[]>;
}
