Discounts support / make rates configurable
This commit is contained in:
@@ -48,9 +48,9 @@ const getActiveBookingsForMembersInDateRange = (dateRange, memberIds) => {
|
||||
});
|
||||
};
|
||||
|
||||
const getAllBookingsForYear = (year) => {
|
||||
const startDate = moment.tz(year, 'YYYY', UI_TIMEZONE).startOf('year');
|
||||
const endDate = moment.tz(year, 'YYYY', UI_TIMEZONE).endOf('year');
|
||||
const getAllBookingsForMembersInDateRange = (dateRange, memberIds) => {
|
||||
const startDate = moment.tz(dateRange.startDate, DEFAULT_DATE_FORMAT, UI_TIMEZONE).startOf('day');
|
||||
const endDate = moment.tz(dateRange.endDate, DEFAULT_DATE_FORMAT, UI_TIMEZONE).endOf('day');
|
||||
|
||||
const attributes = [
|
||||
'id',
|
||||
@@ -76,6 +76,12 @@ const getAllBookingsForYear = (year) => {
|
||||
};
|
||||
}
|
||||
|
||||
if (memberIds && Array.isArray(memberIds) && memberIds.length > 0){
|
||||
filters.memberId = {
|
||||
[Op.in]: memberIds
|
||||
};
|
||||
}
|
||||
|
||||
return db.bookingReservation.findAll({
|
||||
attributes,
|
||||
where: filters,
|
||||
@@ -84,5 +90,5 @@ const getAllBookingsForYear = (year) => {
|
||||
|
||||
module.exports = {
|
||||
getActiveBookingsForMembersInDateRange,
|
||||
getAllBookingsForYear,
|
||||
getAllBookingsForMembersInDateRange,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user