/**
 * Bulk Operations Type Definitions
 */

export type BulkOperationType = 
  | 'percentage' 
  | 'fixed' 
  | 'set' 
  | 'increment' 
  | 'decrement' 
  | 'pattern'
  | 'remove';

export type BulkFieldType = 
  | 'price' 
  | 'regular_price' 
  | 'sale_price' 
  | 'stock_quantity' 
  | 'sku'
  | 'image';

export interface BulkOperation {
  field: BulkFieldType;
  operation: BulkOperationType;
  value: string;
  rounding?: number;
  date_from?: string;
  date_to?: string;
}

export interface BulkUpdateRequest {
  variation_ids: number[];
  operations: BulkOperation[];
}

export interface BulkPreviewItem {
  id: number;
  sku?: string;
  price?: string;
  sale_price?: string;
  sale_date_from?: string | null;
  sale_date_to?: string | null;
  stock_quantity?: number;
  image_url?: string;
  changes: {
    field: string;
    current_value: string | number | null;
    new_value: string | number | null;
  }[];
}

export interface BulkPreviewResponse {
  success: boolean;
  data: {
    preview: BulkPreviewItem[];
    count: number;
  };
}

export interface BulkUpdateResponse {
  success: boolean;
  message: string;
  data: {
    processed: number;
    failed: number;
    errors: string[];
  };
}
