schedule
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { IsString, IsNumber, IsBoolean, IsOptional, Min, Max } from 'class-validator';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
export class CreateScheduleDto {
|
||||
@ApiProperty({ example: '2024-01-15', description: 'تاریخ برای برنامه' })
|
||||
@IsString()
|
||||
date!: string;
|
||||
|
||||
@ApiProperty({ example: 900, description: 'زمان باز شدن (دقیقه از نیمه شب)' })
|
||||
@IsNumber()
|
||||
@Min(0)
|
||||
@Max(1440)
|
||||
@Type(() => Number)
|
||||
openTime!: number;
|
||||
|
||||
@ApiProperty({ example: 1380, description: 'زمان بستن (دقیقه از نیمه شب)' })
|
||||
@IsNumber()
|
||||
@Min(0)
|
||||
@Max(1440)
|
||||
@Type(() => Number)
|
||||
closeTime!: number;
|
||||
|
||||
@ApiPropertyOptional({ example: true, description: 'آیا این برنامه فعال است؟' })
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@Type(() => Boolean)
|
||||
isActive?: boolean;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user