import { ApiProperty } from '@nestjs/swagger'; import { SlotType } from '@prisma/client'; import { Type } from 'class-transformer'; import { IsDate, IsDateString, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString, MinDate, } from 'class-validator'; export class CreateBookingSlotDto { @ApiProperty({ example: 'Hello word', }) @IsString() @IsNotEmpty() @Type(() => String) owner: string; @ApiProperty({ example: 'Hello word', }) @IsString() @IsNotEmpty() @Type(() => String) licensePlates: string; @ApiProperty({ example: '10H 346543', }) @IsString() @IsOptional() @Type(() => String) contact: string; @ApiProperty({ example: '', }) @IsString() @IsOptional() @Type(() => String) image: string; @ApiProperty({ example: 1, }) @IsNumber() @IsNotEmpty() @Type(() => Number) slotId: number; @ApiProperty({ example: new Date(), }) @IsDate() @IsNotEmpty() // @MinDate(new Date()) @Type(() => Date) startAt: Date; @ApiProperty({ example: new Date(), }) @IsDate() @IsNotEmpty() @MinDate(new Date()) @Type(() => Date) endAt: Date; @ApiProperty({ example: SlotType.Orther, }) @IsEnum(SlotType) @IsString() @IsOptional() slot_type: SlotType = SlotType.Orther; }