fetch only non-deleted unlocked/unscheduled incidents
This commit is contained in:
@@ -18,7 +18,8 @@ const { getAllFinishedBookings, getFirstPreviousBooking, getFirstNextBooking } =
|
|||||||
const getSortedIncidentsForMember = (memberId) => {
|
const getSortedIncidentsForMember = (memberId) => {
|
||||||
const attributes = ['bookingStart', 'incidentLevel', 'incidentLevelPrice', 'unlockTimestamp'];
|
const attributes = ['bookingStart', 'incidentLevel', 'incidentLevelPrice', 'unlockTimestamp'];
|
||||||
const filters = {
|
const filters = {
|
||||||
memberId
|
memberId,
|
||||||
|
deleted: false
|
||||||
};
|
};
|
||||||
const order = [['unlockTimestamp', 'DESC']];
|
const order = [['unlockTimestamp', 'DESC']];
|
||||||
|
|
||||||
@@ -59,6 +60,7 @@ const insertUnscheduledIncidents = (incidents) => {
|
|||||||
bookingEnd: end,
|
bookingEnd: end,
|
||||||
unlockTimestamp,
|
unlockTimestamp,
|
||||||
lockTimestamp,
|
lockTimestamp,
|
||||||
|
deleted: false
|
||||||
},
|
},
|
||||||
defaults: {...incidentForDB},
|
defaults: {...incidentForDB},
|
||||||
}));
|
}));
|
||||||
@@ -93,6 +95,7 @@ const insertUnlockedIncidents = (incidents) => {
|
|||||||
bookingEnd: end,
|
bookingEnd: end,
|
||||||
unlockTimestamp,
|
unlockTimestamp,
|
||||||
incidentLevel,
|
incidentLevel,
|
||||||
|
deleted: false
|
||||||
},
|
},
|
||||||
defaults: {...incidentForDB},
|
defaults: {...incidentForDB},
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ const { getChargedCanceledReservations } = require('../integration/bookingChange
|
|||||||
const getUnlockedIncidents = (startDate, endDate, memberIds) => {
|
const getUnlockedIncidents = (startDate, endDate, memberIds) => {
|
||||||
const attributes = ['id', 'reservationId', 'memberId', 'resourceId', 'bookingStart', 'bookingEnd', 'unlockTimestamp', 'incidentLevel', 'incidentLevelPrice'];
|
const attributes = ['id', 'reservationId', 'memberId', 'resourceId', 'bookingStart', 'bookingEnd', 'unlockTimestamp', 'incidentLevel', 'incidentLevelPrice'];
|
||||||
|
|
||||||
const filters = {};
|
const filters = {
|
||||||
|
deleted: false
|
||||||
|
};
|
||||||
|
|
||||||
if (startDate && endDate) {
|
if (startDate && endDate) {
|
||||||
const bookingStartCondition = {
|
const bookingStartCondition = {
|
||||||
@@ -76,7 +78,9 @@ const getUnscheduledIncidents = (startDate, endDate, memberIds) => {
|
|||||||
'totalChargeFee'
|
'totalChargeFee'
|
||||||
];
|
];
|
||||||
|
|
||||||
const filters = {};
|
const filters = {
|
||||||
|
deleted: false
|
||||||
|
};
|
||||||
|
|
||||||
if (startDate && endDate) {
|
if (startDate && endDate) {
|
||||||
const bookingStartCondition = {
|
const bookingStartCondition = {
|
||||||
|
|||||||
Reference in New Issue
Block a user