32 lines
919 B
TypeScript
32 lines
919 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsString, IsOptional, IsDateString } from 'class-validator';
|
|
import { EquipmentStatus } from '@prisma/client';
|
|
|
|
export class CreateEquipmentDto {
|
|
@ApiProperty({ description: 'Название оборудования' })
|
|
@IsString()
|
|
name: string;
|
|
|
|
@ApiProperty({ description: 'Заводской (серийный) номер' })
|
|
@IsString()
|
|
serialNumber: string;
|
|
|
|
@ApiProperty({ description: 'Дата поверки', required: false })
|
|
@IsOptional()
|
|
@IsDateString()
|
|
dateOfInspection?: string;
|
|
|
|
@ApiProperty({ description: 'Дата изготовления', required: false })
|
|
@IsOptional()
|
|
@IsDateString()
|
|
commissionedAt?: string;
|
|
|
|
@ApiProperty({
|
|
enum: EquipmentStatus,
|
|
enumName: 'EquipmentStatus',
|
|
description: 'Текущий статус',
|
|
required: false
|
|
})
|
|
@IsOptional()
|
|
status?: EquipmentStatus;
|
|
} |