/**
 * Handler Registry Types
 * Pure types for handler metadata and registration
 */

import type { JobHandler, ScheduledJob } from '@stock-bot/types';

/**
 * Metadata for a single operation within a handler
 */
export interface OperationMetadata {
  name: string;
  method: string;
  description?: string;
}

/**
 * Metadata for a scheduled operation
 */
export interface ScheduleMetadata {
  operation: string;
  cronPattern: string;
  priority?: number;
  immediately?: boolean;
  description?: string;
}

/**
 * Complete metadata for a handler
 */
export interface HandlerMetadata {
  name: string;
  service?: string;
  operations: OperationMetadata[];
  schedules?: ScheduleMetadata[];
  version?: string;
  description?: string;
}

/**
 * Handler configuration with operation implementations
 */
export interface HandlerConfiguration {
  name: string;
  operations: Record<string, JobHandler>;
  scheduledJobs?: ScheduledJob[];
}

/**
 * Registry statistics
 */
export interface RegistryStats {
  handlers: number;
  operations: number;
  scheduledJobs: number;
  services: number;
}

/**
 * Handler discovery result
 */
export interface HandlerDiscoveryResult {
  handler: HandlerMetadata;
  constructor: any;
  filePath?: string;
}
