const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('./database/ashtransfer.db');

console.log('🖼️  Updating vehicle images with placeholder CDN URLs...\n');

// Professional vehicle placeholder images from placeholder services
const vehicleImages = {
  'Mercedes E-Class': 'https://images.unsplash.com/photo-1618843479313-40f8afb4b4d8?w=600&h=400&fit=crop',
  'Mercedes S-Class': 'https://images.unsplash.com/photo-1617531653520-bd466741413f?w=600&h=400&fit=crop',
  'Mercedes V-Class': 'https://images.unsplash.com/photo-1570733577846-5285e0c4b9f2?w=600&h=400&fit=crop',
  'Mercedes Sprinter': 'https://images.unsplash.com/photo-1544620347-c4fd4a3d5957?w=600&h=400&fit=crop',
  'Standard Saloon': 'https://images.unsplash.com/photo-1494976388531-d1058494cdd8?w=600&h=400&fit=crop',
  'Estate Car': 'https://images.unsplash.com/photo-1552519507-da3b142c6e3d?w=600&h=400&fit=crop'
};

const stmt = db.prepare('UPDATE cms_vehicles SET image_url = ? WHERE name = ?');

Object.entries(vehicleImages).forEach(([name, url]) => {
  stmt.run(url, name);
  console.log(`✓ Updated ${name}`);
});

stmt.finalize();

db.close(() => {
  console.log('\n🎉 All vehicle images updated!');
  console.log('\n📝 Note: These are high-quality Unsplash car images.');
  console.log('You can replace them with your own images later via the admin panel.');
});
