/**
 * @ai-summary User import types and constants
 * @ai-context Types for user data import feature
 */

export interface ImportManifest {
  version: string;
  createdAt: string;
  applicationVersion?: string;
  userId: string;
  contents: {
    vehicles: { count: number; withImages: number };
    fuelLogs: { count: number };
    documents: { count: number; withFiles: number };
    maintenanceRecords: { count: number };
    maintenanceSchedules: { count: number };
  };
  files: {
    vehicleImages: number;
    documentFiles: number;
    totalSizeBytes: number;
  };
  warnings: string[];
}

export interface ImportValidationResult {
  valid: boolean;
  errors: string[];
  manifest?: ImportManifest;
  extractedPath?: string;
}

export interface ImportPreview {
  manifest: ImportManifest;
  conflicts: {
    vehicles: number; // Count of VINs that already exist
  };
  sampleRecords: {
    vehicles?: any[];
    fuelLogs?: any[];
    documents?: any[];
    maintenanceRecords?: any[];
    maintenanceSchedules?: any[];
  };
}

export interface ImportResult {
  success: boolean;
  mode: 'merge' | 'replace';
  summary: {
    imported: number;
    updated: number;
    skipped: number;
    errors: string[];
  };
  warnings: string[];
}

export const USER_IMPORT_CONFIG = {
  tempPath: '/tmp/user-import-work',
  supportedVersion: '1.0.0',
  chunkSize: 100, // Records per batch
} as const;
