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() {
const query = this.reservationsRepository
.createQueryBuilder()
.where(`DATE(dateRangeStart) >= DATE(:startDate)`, {
.where(
`(DATE(dateRangeStart) >= DATE(:startDate) OR DATE(dateRangeStart) <= DATE(:endDate))`,
{
startDate: dayjs().add(1, 'days').toISOString(),
})
.andWhere(`DATE(dateRangeStart) <= DATE(:endDate)`, {
endDate: dayjs().add(7, 'days').toISOString(),
})
},
)
.andWhere('status = :status', {
statuses: ReservationStatus.Pending,
})