const amadeus = require('../config/amadeusClient');

async function getFlightStatus(carrierCode, flightNumber, scheduledDepartureDate) {
  try {
    const response = await amadeus.schedule.flights.get({
      carrierCode: carrierCode,
      flightNumber: flightNumber,
      scheduledDepartureDate: scheduledDepartureDate
  });
    return response.data;
  } catch (error) {
    throw error;
  }
}

module.exports = {
  getFlightStatus,
};
