71 lines
2.2 KiB
TypeScript
71 lines
2.2 KiB
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
||
import { Type } from 'class-transformer';
|
||
import { IsString, IsNotEmpty, IsEnum, IsISO8601, IsOptional, IsBoolean } from 'class-validator';
|
||
import { RepairKind, RepairOrderStatus } from '@prisma/client';
|
||
|
||
export class CreateRepairOrderDto {
|
||
@ApiProperty({ description: 'Номер заявки' })
|
||
@IsString()
|
||
@IsNotEmpty()
|
||
number: string;
|
||
|
||
@ApiProperty({ description: 'Дата заявки' })
|
||
@IsISO8601()
|
||
@Type(() => Date)
|
||
date: Date;
|
||
|
||
@ApiProperty({ description: 'Идентификатор оборудования' })
|
||
@IsString()
|
||
@IsNotEmpty()
|
||
equipmentId: string;
|
||
|
||
@ApiProperty({ enum: RepairKind, enumName: 'RepairKind', description: 'Вид ремонта' })
|
||
@IsEnum(RepairKind)
|
||
repairKind: RepairKind;
|
||
|
||
@ApiProperty({ enum: RepairOrderStatus, enumName: 'RepairOrderStatus', description: 'Статус заявки', required: false })
|
||
@IsEnum(RepairOrderStatus)
|
||
@IsOptional()
|
||
status?: RepairOrderStatus;
|
||
|
||
@ApiProperty({ description: 'Плановая дата начала' })
|
||
@IsISO8601()
|
||
@Type(() => Date)
|
||
plannedAt: Date;
|
||
|
||
@ApiProperty({ description: 'Фактическая дата начала', required: false })
|
||
@IsISO8601()
|
||
@Type(() => Date)
|
||
@IsOptional()
|
||
startedAt?: Date;
|
||
|
||
@ApiProperty({ description: 'Фактическая дата завершения', required: false })
|
||
@IsISO8601()
|
||
@Type(() => Date)
|
||
@IsOptional()
|
||
completedAt?: Date;
|
||
|
||
@ApiProperty({ description: 'Подрядная организация (если внешний ремонт)', required: false })
|
||
@IsString()
|
||
@IsOptional()
|
||
contractor?: string;
|
||
|
||
@ApiProperty({ description: 'Наработка на момент ремонта, моточасов', required: false })
|
||
@IsOptional()
|
||
engineHoursAtRepair?: any;
|
||
|
||
@ApiProperty({ description: 'Описание работ / дефекта', required: false })
|
||
@IsString()
|
||
@IsOptional()
|
||
description?: string;
|
||
|
||
@ApiProperty({ description: 'Примечания', required: false })
|
||
@IsString()
|
||
@IsOptional()
|
||
notes?: string;
|
||
|
||
@ApiProperty({ description: 'Согласовано/Не согласовано', required: false })
|
||
@IsBoolean()
|
||
@IsOptional()
|
||
confirmed?: boolean;
|
||
} |