Making end date inclusive for schedulable reservations

This commit is contained in:
Collin Duncan 2025-04-15 08:54:32 +02:00
parent afb733608d
commit 94ddf55639
No known key found for this signature in database

View file

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