chore: import DH V2 D5.6.4 production baseline

This commit is contained in:
DH V2
2026-09-05 10:12:35 -03:00
commit 82213e72f5
757 changed files with 84218 additions and 0 deletions
@@ -0,0 +1,57 @@
import { Transform, Type } from 'class-transformer';
import {
IsInt,
IsOptional,
IsString,
IsUUID,
Matches,
Max,
MaxLength,
Min,
MinLength,
ValidateIf,
} from 'class-validator';
const optionalText = ({ value }: { value: unknown }) =>
typeof value === 'string' && value.trim() ? value.trim() : null;
export class CreateInspectionFindingDto {
@IsUUID('4')
assetId!: string;
@IsOptional()
@Transform(optionalText)
@IsUUID('4')
catalogItemId?: string | null;
@ValidateIf((value: CreateInspectionFindingDto) => !value.catalogItemId)
@Transform(optionalText)
@IsString()
@MinLength(1)
@MaxLength(500)
customTitle?: string | null;
@IsOptional()
@Transform(optionalText)
@IsString()
@MaxLength(12000)
customLegalBasis?: string | null;
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MinLength(1)
@MaxLength(20000)
description!: string;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(10)
severity?: number;
@IsOptional()
@Transform(optionalText)
@Matches(/^\d{4}-\d{2}-\d{2}$/)
correctionDueOn?: string | null;
}