import { Request } from 'express';

// API Request/Response types
export interface GenerateImageRequest {
  prompt: string;
  filename: string;
}

export interface GenerateImageResponse {
  success: boolean;
  message: string;
  data?: {
    filename: string;
    filepath: string;
    description?: string;
    model: string;
    generatedAt: string;
  };
  error?: string;
}

// Extended Express Request with file uploads
export interface GenerateImageRequestWithFiles extends Request {
  body: GenerateImageRequest;
  files?: Express.Multer.File[];
}

// Image generation service types
export interface ImageGenerationOptions {
  prompt: string;
  filename: string;
  referenceImages?: ReferenceImage[];
}

export interface ReferenceImage {
  buffer: Buffer;
  mimetype: string;
  originalname: string;
}

export interface ImageGenerationResult {
  success: boolean;
  filename?: string;
  filepath?: string;
  description?: string;
  model: string;
  error?: string;
}

// Logging types
export interface LogContext {
  requestId: string;
  endpoint: string;
  method: string;
  timestamp: string;
}

// Environment configuration
export interface Config {
  port: number;
  geminiApiKey: string;
  resultsDir: string;
  uploadsDir: string;
  maxFileSize: number;
  maxFiles: number;
}