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

// Get list of hotel offers (Hotel Search API V3)
exports.getMultiHotelOffers = async (params) => {
  if (!amadeus.shopping || !amadeus.shopping.hotelOffersSearch) {
    throw new Error('Amadeus SDK does not have shopping.hotelOffersSearch');
  }

  const response = await amadeus.shopping.hotelOffersSearch.get(params);
  return response.data;
};

// Get specific offer details (Hotel Offer API V3)
exports.getOfferPricing = async (offerId) => {
  if (!amadeus.shopping || !amadeus.shopping.hotelOfferSearch) {
    throw new Error('Amadeus SDK does not have shopping.hotelOfferSearch');
  }

  const response = await amadeus.shopping.hotelOfferSearch(offerId).get();
  return response.data;
};
