28 lines
602 B
TypeScript
28 lines
602 B
TypeScript
import { Transform, Type } from 'class-transformer';
|
|
import { IsDate, IsOptional, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
|
|
|
|
export class ChangeAssetContextDto {
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
parentId?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
operationalAreaId?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsUUID('4')
|
|
operatorCompanyId?: string | null;
|
|
|
|
@IsOptional()
|
|
@Type(() => Date)
|
|
@IsDate()
|
|
effectiveAt?: Date;
|
|
|
|
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
|
|
@IsString()
|
|
@MinLength(5)
|
|
@MaxLength(2000)
|
|
reason!: string;
|
|
}
|