Skip to content

Commit

Permalink
passed the test and readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
minjikarin committed Jun 17, 2024
1 parent 6bd1777 commit 1ca48c0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,16 @@ amadeus.shopping.hotelOffersSearch.get({
// Check offer conditions of a specific offer id
amadeus.shopping.hotelOfferSearch('XXX').get()

// Hotel Booking API
// Hotel Booking API V2
amadeus.booking.hotelOrders.post({
guests: [],
travelAgent: {},
roomAssociations: [],
payment: {}
})


// Hotel Booking API V1
amadeus.booking.hotelBookings.post(
JSON.stringify({
'offerId': 'XXX',
Expand Down
12 changes: 11 additions & 1 deletion spec/amadeus/namespaces.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ describe('Namespaces', () => {
expect(amadeus.shopping.flightOffers.pricing.post).toBeDefined();
expect(amadeus.shopping.seatmaps.post).toBeDefined();
expect(amadeus.booking.hotelBookings.post).toBeDefined();
expect(amadeus.booking.hotelOrders.post).toBeDefined();
expect(amadeus.shopping.transferOffers.post).toBeDefined();
expect(amadeus.ordering.transferOrders.post).toBeDefined();
expect(amadeus.ordering.transferOrder('XXX').transfers.cancellation.post).toBeDefined();
Expand Down Expand Up @@ -451,7 +452,16 @@ describe('Namespaces', () => {
amadeus.client.post = jest.fn();
amadeus.booking.hotelOrders.post();
expect(amadeus.client.post)
.toHaveBeenCalledWith('/v2/booking/hotel-orders', {});
.toHaveBeenCalledWith('/v2/booking/hotel-orders', JSON.stringify({
data: {
type: 'hotel-order',
guests: [],
travelAgent: {},
roomAssociations: [],
payment: {},
arrivalInformation: {}
}
}));
});

it('.amadeus.eReputation.hotelSentiments.get', () => {
Expand Down
3 changes: 2 additions & 1 deletion src/amadeus/namespaces/booking/hotel_orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class HotelOrders {
* 'guests': [],
* 'travel_agent: {},
* 'room_associations: [],
* 'payment': {}
* 'payment': {},
* 'arrivalInformation': {}
* });
* ```
*/
Expand Down

0 comments on commit 1ca48c0

Please sign in to comment.