add deleteFees route and implement logic

This commit is contained in:
Bilal Catic
2019-11-21 07:12:50 +01:00
parent 3d051766b1
commit 8a3db0d481
4 changed files with 76 additions and 1 deletions

View File

@@ -274,6 +274,16 @@ const deleteBookingChangeIncidents = (incidents) => {
return Promise.all(asyncActions);
};
const deleteBookingChangeIncidentsById = (incidentIds) => {
console.log('Delete booking changes in DB :', incidentIds);
const filters = {
id: {
[Op.in]: incidentIds
}
};
return db.bookingChangeIncident.update({deleted: true},{where: filters});
};
module.exports = {
getChargedCanceledReservations,
getIncidentsFromChanges,
@@ -281,4 +291,5 @@ module.exports = {
getShorteningIncidentsForReservationId,
getReservationsIncidentsForRemoval,
deleteBookingChangeIncidents,
deleteBookingChangeIncidentsById
};