Files
serverMontime/src/modules/business-services/dto/create-business-service.dto.ts
T

32 lines
868 B
TypeScript
Raw Normal View History

2026-05-12 16:17:39 +03:30
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsBoolean, IsInt, IsNumber, IsOptional, IsUUID, Max, Min } from 'class-validator';
2026-05-09 17:07:15 +03:30
export class CreateBusinessServiceDto {
2026-05-12 16:17:39 +03:30
@ApiProperty({ format: 'uuid' })
@IsUUID()
2026-05-09 17:07:15 +03:30
businessId!: string;
2026-05-12 16:17:39 +03:30
@ApiProperty({ format: 'uuid' })
@IsUUID()
2026-05-09 17:07:15 +03:30
serviceTemplateId!: string;
2026-05-12 16:17:39 +03:30
2026-05-09 17:07:15 +03:30
/** قیمت به واحد پول (عدد اعشاری مجاز است) */
2026-05-12 16:17:39 +03:30
@ApiProperty({ example: 100000 })
@IsNumber({ maxDecimalPlaces: 2 })
@Min(0)
2026-05-09 17:07:15 +03:30
price!: number;
2026-05-12 16:17:39 +03:30
2026-05-09 17:07:15 +03:30
/** اگر خالی باشد از template.defaultDurationMinutes استفاده می‌شود */
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: 30, nullable: true })
@IsOptional()
@IsInt()
@Min(1)
@Max(1440)
2026-05-09 17:07:15 +03:30
durationMinutes?: number | null;
2026-05-12 16:17:39 +03:30
@ApiPropertyOptional({ example: true })
@IsOptional()
@IsBoolean()
2026-05-09 17:07:15 +03:30
isActive?: boolean;
}