Member Practice Summary Report and bugfixes
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
const moment = require('moment-timezone');
|
||||
const db = require('../../models/index');
|
||||
const Op = require('sequelize').Op;
|
||||
|
||||
const { UI_TIMEZONE, BOOKING_CHANGE_PERCENTAGE_CHARGE, ALLOWED_BOOKING_CANCELLATION_TIME, incidentType } = require('../../constants/constants');
|
||||
|
||||
@@ -128,6 +129,20 @@ const chargeBookingChanges = (changes) => {
|
||||
});
|
||||
};
|
||||
|
||||
const getChargedCanceledReservations = (reservationIds) => {
|
||||
const filters = {
|
||||
reservationId: {
|
||||
[Op.in]: reservationIds,
|
||||
},
|
||||
incidentType: incidentType.BOOKING_CANCELED_LATE,
|
||||
};
|
||||
|
||||
const attributes = ['memberId', 'oldBookingStart', 'oldBookingEnd'];
|
||||
|
||||
return db.bookingChangeIncident.findAll({attributes, where: filters});
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
chargeBookingChanges,
|
||||
getChargedCanceledReservations,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user