import { HotelInterceptApis, bookHotel } from '@hotel-lib/index';
import { LoginPage } from '@admin-lib/index';
import { User_Type } from '@support-onboard/index';
import { Emea_Fee_Types } from '@support-commerce/data_model/fee_types';
import { stagingUsers } from '@fixtures/staging-users';
import { TripFeeValidation } from '@commerce-lib/tripfee/trip_fee_validation';
import { CommerceApiIntercepts } from '@commerce-shared-lib/api-intercepts';

const adminCredentials = Cypress.env('superAdmin').SUPER_ADMIN_PASSWORD;
const emeaFeeModelType = Emea_Fee_Types.EMEA_FEE_MODEL_A_USD_N;
const emeaFeesTagSet: Array<string> = [
  'bookingOnline',
  'tripOnline',
  'booking1',
  'inventoryTypeHotel'
];

describe('Commerce: HOTEL | USD | BUSINESS | BOOKING Test', () => {
  beforeEach(() => {
    CommerceApiIntercepts.interceptCommerceApis();
    cy.loginWithAuthToken({
      email: stagingUsers.superAdmin.email,
      password: adminCredentials,
      isSA: true
    });
    TripFeeValidation.getAndStoreFeeModelUUID(emeaFeeModelType);
    TripFeeValidation.getTripFeeUsingFeeModelUUID(emeaFeesTagSet);
    LoginPage.createNewCompanyAndLoginWithUserByType({
      users: [User_Type.TRAVELER],
      feeModelInfo: Emea_Fee_Types.EMEA_FEE_MODEL_A_USD_N
    });
    HotelInterceptApis.interceptHotelApis();
  });

  it(
    'C1204251: Verify Hotel Invoice for PREPAY Hotel (USD)',
    { tags: ['@tier1'] },
    () => {
      bookHotel('Business', []);
    }
  );
});
