This commit is contained in:
Mhd Zayd Skaff
2025-07-20 16:36:12 +03:00
parent 212d0d1974
commit db95cc0dab
2 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,12 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsDate, IsNotEmpty, IsString, IsUUID, Matches } from 'class-validator';
import {
IsDate,
IsNotEmpty,
IsString,
IsUUID,
Matches,
MinDate,
} from 'class-validator';
export class CreateBookingDto {
@ApiProperty({
@ -15,6 +22,7 @@ export class CreateBookingDto {
})
@IsNotEmpty()
@IsDate()
@MinDate(new Date())
date: Date;
@ApiProperty({ example: '09:00' })

View File

@ -54,7 +54,8 @@ export class BookableSpaceService {
.createQueryBuilder('space')
.leftJoinAndSelect('space.parent', 'parentSpace')
.leftJoinAndSelect('space.community', 'community')
.where('community.project = :project', { project });
.where('space.disabled = :disabled', { disabled: false })
.andWhere('community.project = :project', { project });
if (search) {
qb = qb.andWhere(