remove incidents if new duration is longer than initial duration

This commit is contained in:
Bilal Catic
2019-08-24 09:26:52 +02:00
parent 934ffa90a7
commit 9c855692b7
3 changed files with 154 additions and 36 deletions

View File

@@ -50,6 +50,17 @@ const bulkWriteChanges = (changes) => {
// return new Promise((resolve) => resolve());
};
const getBookingChangeLogsForReservationId = (reservationId) => {
const filter = {
reservationId,
};
const order = [['createdAt', 'ASC']];
return db.bookingReservationChangeLog.findAll({where: filter, order});
};
module.exports = {
bulkWriteChanges,
getBookingChangeLogsForReservationId,
};