canina/backend/src/pets/dto/create-pet.dto.ts

41 lines
1.1 KiB
TypeScript

import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsNotEmpty, IsString, IsOptional, IsNumber, IsArray } from 'class-validator';
export class CreatePetDto {
@ApiProperty({ description: 'نام حیوان خانگی', example: 'بادی' })
@IsNotEmpty()
@IsString()
name: string;
@ApiProperty({ description: 'نوع (سگ/گربه)', example: 'سگ' })
@IsNotEmpty()
@IsString()
type: string;
@ApiPropertyOptional({ description: 'نژاد', example: 'ژرمن شپرد' })
@IsOptional()
@IsString()
breed?: string;
@ApiPropertyOptional({ description: 'وزن (کیلوگرم)', example: 25.5 })
@IsOptional()
@IsNumber()
weight?: number;
@ApiPropertyOptional({ description: 'سن (سال)', example: 3 })
@IsOptional()
@IsNumber()
age?: number;
@ApiPropertyOptional({ description: 'سطح فعالیت', example: 'متوسط' })
@IsOptional()
@IsString()
activityLevel?: string;
@ApiPropertyOptional({ description: 'سوابق پزشکی', type: [String] })
@IsOptional()
@IsArray()
@IsString({ each: true })
medicalConditions?: string[];
}