edit time rezerv

This commit is contained in:
2026-05-25 20:06:10 +03:30
parent 8263198d1e
commit a8c255a3a4
3 changed files with 82 additions and 2 deletions
@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { Transform, Type } from 'class-transformer';
import {
ArrayMaxSize,
IsArray,
@@ -10,20 +10,24 @@ import {
Min,
ValidateNested,
} from 'class-validator';
import { normalizeHmTimeInput } from '../../../common/utils/booking-schedule.util';
export class AvailabilitySlotDto {
@ApiProperty({ description: '0=شنبه … 6=جمعه', minimum: 0, maximum: 6 })
@Type(() => Number)
@IsInt()
@Min(0)
@Max(6)
dayOfWeek!: number;
@ApiProperty({ example: '09:00' })
@Transform(({ value }) => normalizeHmTimeInput(value) ?? value)
@IsString()
@Matches(/^([01]\d|2[0-3]):[0-5]\d]$/)
startTime!: string;
@ApiProperty({ example: '17:00' })
@Transform(({ value }) => normalizeHmTimeInput(value) ?? value)
@IsString()
@Matches(/^([01]\d|2[0-3]):[0-5]\d]$/)
endTime!: string;