fetch reservations, find and update changed reservations

This commit is contained in:
Bilal Catic
2019-06-27 05:38:45 +02:00
parent aedb09d1be
commit 7aab1e538e
7 changed files with 127 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
'use strict';
require('dotenv').config();
const { fetchAllBookings, bulkWriteReservationsWithChangesTracking } = require('../services/officeRnD/bookings');
const checkBookingChanges = () => {
fetchAllBookings()
.then((reservations) => {
bulkWriteReservationsWithChangesTracking(reservations)
.then((changes) => {
console.log('== CHANGES == ');
console.log(changes);
})
.catch((error) => {
console.log('Error bulk write booking reservations :', error);
});
})
.catch((error) => {
console.log('Error fetching bookings from ORD ', error);
});
};
checkBookingChanges();