Fix for loading
This commit is contained in:
@@ -1,41 +1,6 @@
|
||||
'use strict';
|
||||
require('dotenv').config();
|
||||
|
||||
const { fetchAllBookings, bulkWriteReservationsWithChangesTracking } = require('../services/officeRnD/bookings');
|
||||
const { checkBookingChanges } = require('../services/integration/checkBookingChange');
|
||||
|
||||
const { chargeBookingChanges } = require('../services/integration/bookingChangeCharges');
|
||||
const { bulkWriteChanges } = require('../services/integration/bookingChangeLog');
|
||||
|
||||
const checkBookingChanges = () => {
|
||||
fetchAllBookings()
|
||||
.then((reservations) => {
|
||||
bulkWriteReservationsWithChangesTracking(reservations)
|
||||
.then((changes) => {
|
||||
bulkWriteChanges(changes)
|
||||
.then(() => {
|
||||
chargeBookingChanges(changes)
|
||||
.then(() => {
|
||||
process.exit();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('Error creating charges ', error);
|
||||
process.exit();
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('Error bulk write booking reservation change log :', error);
|
||||
process.exit();
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('Error bulk write booking reservations :', error);
|
||||
process.exit();
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('Error fetching bookings from ORD ', error);
|
||||
process.exit();
|
||||
});
|
||||
};
|
||||
|
||||
checkBookingChanges();
|
||||
checkBookingChanges().then(() => process.exit()).catch(() => process.exit());
|
||||
|
||||
Reference in New Issue
Block a user