import { IsObject } from 'class-validator';

export class ImportPayloadDto {
  @IsObject()
  payload: ExportPayload;
}

export interface ExportPayload {
  version: number;
  exportedAt: string;
  workflow: {
    code: string;
    name: string;
    description: string | null;
    status: string;
    dsl: any;
  };
  nodeInstances: Array<{
    sourceId: string;
    code: string;
    name: string;
    description: string | null;
    nodeTypeKey: string;
    config: any;
    isEnabled: boolean;
  }>;
  nodeTypes: Array<{
    type: string;
    category: string;
    label: string;
    icon: string;
    description: string | null;
    configSchema: any;
    inputSchema: any;
    outputSchema: any;
    isBuiltin: boolean;
  }>;
}

export interface ImportPreviewResponse {
  current: Partial<ExportPayload> | null;
  incoming: ExportPayload;
}
