const BaseController = require('./BaseController'); const heytripService = require('../services/heytripService'); class Heytrip extends BaseController { getAids = async (ctx) => { try { const { nextPage } = await heytripService.syncAids(); ctx.body = this.response(0, 'get_heytrip_ids', nextPage); } catch (error) { // console.error(error); ctx.body = this.response(1, error.message || 'An error occurred.'); } }; getHotelInfo = async (ctx) => { const { data } = await heytripService.syncHotelDetails(); ctx.body = this.response(0, 'get_hotel_info', data); }; getAvailability = async (ctx) => { try { const data = await heytripService.getHotelAvailability(ctx.query); ctx.body = this.response(0, 'get_hotel_availability', data); } catch (error) { ctx.body = this.response(1, error.message || 'An error occurred.'); } }; } module.exports = new Heytrip();