Fixing incorrect inequality when fetching schedulable reservations
Some checks are pending
Push to main / test (push) Waiting to run
Push to main / build-image (push) Blocked by required conditions

This commit is contained in:
Collin Duncan 2025-04-22 09:23:27 +02:00
parent 94ddf55639
commit 01a6013093
No known key found for this signature in database

View file

@ -48,12 +48,13 @@ export class ReservationsService {
async getSchedulable() { async getSchedulable() {
const query = this.reservationsRepository const query = this.reservationsRepository
.createQueryBuilder() .createQueryBuilder()
.where(`DATE(dateRangeStart) >= DATE(:startDate)`, { .where(
startDate: dayjs().add(1, 'days').toISOString(), `(DATE(dateRangeStart) >= DATE(:startDate) OR DATE(dateRangeStart) <= DATE(:endDate))`,
}) {
.andWhere(`DATE(dateRangeStart) <= DATE(:endDate)`, { startDate: dayjs().add(1, 'days').toISOString(),
endDate: dayjs().add(7, 'days').toISOString(), endDate: dayjs().add(7, 'days').toISOString(),
}) },
)
.andWhere('status = :status', { .andWhere('status = :status', {
statuses: ReservationStatus.Pending, statuses: ReservationStatus.Pending,
}) })