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