// Script to populate VIPs in VIP Coordinator // All VIPs flying into Denver International Airport (DEN) const API_BASE = 'http://localhost:3000/api'; // Function to add VIPs async function addVips() { console.log('šŸš€ Adding VIPs...'); let successCount = 0; // VIP 1 - Sarah Johnson let response = await fetch(`${API_BASE}/vips`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: "Sarah Johnson", organization: "Tech Innovations Inc", transportMode: "flight", flights: [{"flightNumber": "UA1234", "flightDate": "2025-06-26", "segment": 1}], needsAirportPickup: true, needsVenueTransport: true, notes: "CEO - Requires executive transport" }) }); if (response.ok) { console.log(' āœ… Added Sarah Johnson'); successCount++; } else { console.error(' āŒ Failed to add Sarah Johnson'); } // VIP 2 - Michael Chen response = await fetch(`${API_BASE}/vips`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: "Michael Chen", organization: "Global Finance Corp", transportMode: "flight", flights: [ {"flightNumber": "AA2547", "flightDate": "2025-06-26", "segment": 1}, {"flightNumber": "AA789", "flightDate": "2025-06-26", "segment": 2} ], needsAirportPickup: true, needsVenueTransport: true, notes: "Has connecting flight through Dallas" }) }); if (response.ok) { console.log(' āœ… Added Michael Chen'); successCount++; } else { console.error(' āŒ Failed to add Michael Chen'); } // VIP 3 - Emily Rodriguez response = await fetch(`${API_BASE}/vips`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: "Emily Rodriguez", organization: "Healthcare Solutions", transportMode: "flight", flights: [{"flightNumber": "DL456", "flightDate": "2025-06-27", "segment": 1}], needsAirportPickup: true, needsVenueTransport: false, notes: "Will have rental car for venue transport" }) }); if (response.ok) { console.log(' āœ… Added Emily Rodriguez'); successCount++; } else { console.error(' āŒ Failed to add Emily Rodriguez'); } // VIP 4 - David Thompson (self-driving) response = await fetch(`${API_BASE}/vips`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: "David Thompson", organization: "Energy Dynamics", transportMode: "self-driving", expectedArrival: "2025-06-26T14:00:00", needsAirportPickup: false, needsVenueTransport: true, notes: "Driving from Colorado Springs" }) }); if (response.ok) { console.log(' āœ… Added David Thompson'); successCount++; } else { console.error(' āŒ Failed to add David Thompson'); } // VIP 5 - Lisa Wang response = await fetch(`${API_BASE}/vips`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: "Lisa Wang", organization: "AI Research Lab", transportMode: "flight", flights: [{"flightNumber": "UA852", "flightDate": "2025-06-26", "segment": 1}], needsAirportPickup: true, needsVenueTransport: true, notes: "Keynote speaker - VIP treatment required" }) }); if (response.ok) { console.log(' āœ… Added Lisa Wang'); successCount++; } else { console.error(' āŒ Failed to add Lisa Wang'); } console.log(`\nAdded ${successCount} VIPs successfully`); } // Main function async function populateVips() { console.log('šŸš€ Starting to populate VIPs...\n'); // Check if API is available try { const healthCheck = await fetch(`${API_BASE}/health`); if (!healthCheck.ok) { console.error('āŒ API is not responding. Make sure the backend is running on port 3000'); return; } } catch (error) { console.error('āŒ Cannot connect to API. Make sure the backend is running on port 3000'); return; } await addVips(); console.log('\nāœ… VIP population complete!'); console.log('\nYou can now:'); console.log('1. View all VIPs at http://localhost:5173/vips'); console.log('2. Manage drivers at http://localhost:5173/drivers'); console.log('3. Create schedules for the VIPs'); console.log('4. Test flight tracking and validation'); } // Run the script populateVips().catch(console.error);