Files
old-psihologija/cronServices/checkBookingChanges.js

25 lines
753 B
JavaScript

'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();