mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-08-25 21:29:40 +00:00
32 lines
851 B
TypeScript
32 lines
851 B
TypeScript
import { BooleanValues } from '@app/common/constants/boolean-values.enum';
|
|
import { PaginationRequestWithSearchGetListDto } from '@app/common/dto/pagination-with-search.request.dto';
|
|
import { ApiProperty, OmitType } from '@nestjs/swagger';
|
|
import { Transform } from 'class-transformer';
|
|
import { IsBoolean, IsNotEmpty, IsOptional } from 'class-validator';
|
|
|
|
export class BookableSpaceRequestDto extends OmitType(
|
|
PaginationRequestWithSearchGetListDto,
|
|
['includeSpaces'],
|
|
) {
|
|
@ApiProperty({
|
|
type: Boolean,
|
|
required: false,
|
|
})
|
|
@IsBoolean()
|
|
@IsOptional()
|
|
@Transform(({ obj }) => {
|
|
return obj.active === BooleanValues.TRUE;
|
|
})
|
|
active?: boolean;
|
|
|
|
@ApiProperty({
|
|
type: Boolean,
|
|
})
|
|
@IsBoolean()
|
|
@IsNotEmpty()
|
|
@Transform(({ obj }) => {
|
|
return obj.configured === BooleanValues.TRUE;
|
|
})
|
|
configured: boolean;
|
|
}
|