chore: import DH V2 D5.6.4 production baseline
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import {
|
||||
IsEnum,
|
||||
IsISO8601,
|
||||
IsOptional,
|
||||
IsString,
|
||||
MaxLength,
|
||||
} from 'class-validator';
|
||||
import { AssetDataOrigin } from '../../database/entities';
|
||||
|
||||
const nullableTrim = ({ value }: { value: unknown }) =>
|
||||
typeof value === 'string' ? value.trim() || null : value;
|
||||
|
||||
export class UpdateAssetProvenanceDto {
|
||||
@IsEnum(AssetDataOrigin)
|
||||
origin!: AssetDataOrigin;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(nullableTrim)
|
||||
@IsString()
|
||||
@MaxLength(160)
|
||||
sourceName?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(nullableTrim)
|
||||
@IsString()
|
||||
@MaxLength(255)
|
||||
sourceReference?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsISO8601({ strict: true })
|
||||
observedAt?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(nullableTrim)
|
||||
@IsString()
|
||||
@MaxLength(4000)
|
||||
notes?: string | null;
|
||||
}
|
||||
Reference in New Issue
Block a user