add & edit time rezerv
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Transform, Type } from 'class-transformer';
|
||||
import { Type } from 'class-transformer';
|
||||
import {
|
||||
ArrayMaxSize,
|
||||
IsArray,
|
||||
IsInt,
|
||||
IsString,
|
||||
Matches,
|
||||
Max,
|
||||
Min,
|
||||
ValidateNested,
|
||||
} from 'class-validator';
|
||||
import { normalizeHmTimeInput } from '../../../common/utils/booking-schedule.util';
|
||||
|
||||
export class AvailabilitySlotDto {
|
||||
@ApiProperty({ description: '0=شنبه … 6=جمعه', minimum: 0, maximum: 6 })
|
||||
@@ -20,16 +18,12 @@ export class AvailabilitySlotDto {
|
||||
@Max(6)
|
||||
dayOfWeek!: number;
|
||||
|
||||
@ApiProperty({ example: '09:00' })
|
||||
@Transform(({ value }) => normalizeHmTimeInput(value) ?? value)
|
||||
@ApiProperty({ example: '09:00', description: 'HH:mm 24h (9:00 also accepted)' })
|
||||
@IsString()
|
||||
@Matches(/^([01]\d|2[0-3]):[0-5]\d]$/)
|
||||
startTime!: string;
|
||||
|
||||
@ApiProperty({ example: '17:00' })
|
||||
@Transform(({ value }) => normalizeHmTimeInput(value) ?? value)
|
||||
@ApiProperty({ example: '17:00', description: 'HH:mm 24h (17:30 also accepted)' })
|
||||
@IsString()
|
||||
@Matches(/^([01]\d|2[0-3]):[0-5]\d]$/)
|
||||
endTime!: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user