Files
toir-light-v14/backend/src/repair-order/dto/create-repair-order.dto.ts
2026-04-25 14:01:39 +00:00

71 lines
2.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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;
}