feat: add generated code
This commit is contained in:
43
backend/src/equipment/dto/create-equipment.dto.ts
Normal file
43
backend/src/equipment/dto/create-equipment.dto.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import {
|
||||
IsString,
|
||||
IsNotEmpty,
|
||||
IsEnum,
|
||||
IsISO8601,
|
||||
IsOptional,
|
||||
} from 'class-validator';
|
||||
import { EquipmentStatus } from '@prisma/client';
|
||||
|
||||
export class CreateEquipmentDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
name: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
serialNumber: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsISO8601()
|
||||
@Type(() => Date)
|
||||
@IsOptional()
|
||||
dateOfInspection?: Date;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsISO8601()
|
||||
@Type(() => Date)
|
||||
@IsOptional()
|
||||
commissionedAt?: Date;
|
||||
|
||||
@ApiProperty({
|
||||
enum: EquipmentStatus,
|
||||
enumName: 'EquipmentStatus',
|
||||
required: false,
|
||||
})
|
||||
@IsEnum(EquipmentStatus)
|
||||
@IsOptional()
|
||||
status?: EquipmentStatus;
|
||||
}
|
||||
Reference in New Issue
Block a user