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,2 @@
import { Transform,Type } from 'class-transformer'; import { IsDateString,IsEnum,IsNumber,IsOptional,IsString,IsUUID,Max,MaxLength,Min } from 'class-validator'; import { AreaLegalRightOrganizationRole } from '../../database/entities';
export class AddAreaLegalRightOrganizationDto { @IsUUID('4') organizationId!:string; @IsEnum(AreaLegalRightOrganizationRole) role!:AreaLegalRightOrganizationRole; @IsOptional() @Type(()=>Number) @IsNumber({maxDecimalPlaces:4}) @Min(0.0001) @Max(100) participationPercent?:number|null; @IsOptional() @IsDateString() validFrom?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(2000) notes?:string|null; }
@@ -0,0 +1,2 @@
import { Transform,Type } from 'class-transformer'; import { IsDateString,IsEnum,IsNumber,IsOptional,IsString,IsUUID,Max,MaxLength,Min } from 'class-validator'; import { OrganizationMembershipRole } from '../../database/entities';
export class AddOrganizationMembershipDto { @IsUUID('4') memberOrganizationId!:string; @IsEnum(OrganizationMembershipRole) role:OrganizationMembershipRole=OrganizationMembershipRole.MEMBER; @IsOptional() @Type(()=>Number) @IsNumber({maxDecimalPlaces:4}) @Min(0.0001) @Max(100) participationPercent?:number|null; @IsOptional() @IsDateString() validFrom?:string|null; @IsOptional() @IsUUID('4') sourceDocumentId?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(2000) notes?:string|null; }
@@ -0,0 +1,27 @@
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;
}
@@ -0,0 +1,3 @@
import { IsEnum } from 'class-validator';
import { AssetOperationalStatus } from '../../database/entities';
export class ChangeAssetOperationalStatusDto { @IsEnum(AssetOperationalStatus) status!: AssetOperationalStatus; }
@@ -0,0 +1,7 @@
import { IsEnum } from 'class-validator';
import { AssetInformationStatus } from '../../database/entities';
export class ChangeAssetStatusDto {
@IsEnum(AssetInformationStatus)
informationStatus!: AssetInformationStatus;
}
@@ -0,0 +1,13 @@
import { Transform, Type } from 'class-transformer';
import { IsEnum, IsNumber, IsOptional, IsString, IsUUID, Max, MaxLength, Min, MinLength } from 'class-validator';
import { AreaOrganizationRole } from '../../database/entities';
export class CreateAreaCompanyRelationDto {
@IsUUID('4') areaId!: string;
@IsUUID('4') companyId!: string;
@IsOptional() @IsEnum(AreaOrganizationRole) relationRole: AreaOrganizationRole = AreaOrganizationRole.OPERATOR;
@IsOptional() @Type(() => Number) @IsNumber({ maxDecimalPlaces: 4 }) @Min(0.0001) @Max(100) participationPercent?: number | null;
@IsOptional() @Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null) @IsString() @MaxLength(240) legalInstrument?: string | null;
@IsOptional() @IsUUID('4') sourceDocumentId?: string | null;
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value)) @IsString() @MinLength(3) @MaxLength(1000) reason!: string;
}
@@ -0,0 +1,2 @@
import { Transform } from 'class-transformer'; import { IsDateString,IsEnum,IsOptional,IsString,IsUUID,MaxLength,MinLength } from 'class-validator'; import { AreaLegalRightStatus,AreaLegalRightType } from '../../database/entities';
export class CreateAreaLegalRightDto { @IsEnum(AreaLegalRightType) rightType!:AreaLegalRightType; @Transform(({value})=>typeof value==='string'?value.trim():value) @IsString() @MinLength(3) @MaxLength(260) name!:string; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(180) instrumentNumber?:string|null; @IsOptional() @IsDateString() validFrom?:string|null; @IsOptional() @IsDateString() validUntil?:string|null; @IsOptional() @IsEnum(AreaLegalRightStatus) status:AreaLegalRightStatus=AreaLegalRightStatus.ACTIVE; @IsOptional() @IsUUID('4') sourceDocumentId?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(4000) notes?:string|null; }
@@ -0,0 +1,52 @@
import { Type } from 'class-transformer';
import {
IsEnum,
IsISO8601,
IsNumber,
IsOptional,
IsString,
Max,
MaxLength,
Min,
} from 'class-validator';
import { AssetMediaKind } from '../../database/entities';
export class CreateAssetMediaDto {
@IsEnum(AssetMediaKind)
kind!: AssetMediaKind;
@IsOptional()
@IsString()
@MaxLength(200)
title?: string;
@IsOptional()
@IsString()
@MaxLength(4000)
description?: string;
@IsOptional()
@IsISO8601({ strict: true })
capturedAt?: string;
@IsOptional()
@Type(() => Number)
@IsNumber({ maxDecimalPlaces: 6 })
@Min(-90)
@Max(90)
latitude?: number;
@IsOptional()
@Type(() => Number)
@IsNumber({ maxDecimalPlaces: 6 })
@Min(-180)
@Max(180)
longitude?: number;
@IsOptional()
@Type(() => Number)
@IsNumber({ maxDecimalPlaces: 3 })
@Min(0)
@Max(100000)
accuracyM?: number;
}
@@ -0,0 +1,46 @@
import { Transform } from 'class-transformer';
import {
ArrayUnique,
IsArray,
IsBoolean,
IsEnum,
IsString,
IsUUID,
Matches,
MaxLength,
MinLength,
} from 'class-validator';
import { AssetTypeOperationalRole } from '../../database/entities';
export class CreateAssetTypeDto {
@Transform(({ value }) =>
typeof value === 'string' ? value.trim().toLowerCase() : value,
)
@IsString()
@MinLength(2)
@MaxLength(80)
@Matches(/^[a-z][a-z0-9_-]+$/)
code!: string;
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MinLength(1)
@MaxLength(160)
name!: string;
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MaxLength(2000)
description!: string;
@IsBoolean()
canBeRoot!: boolean;
@IsEnum(AssetTypeOperationalRole)
operationalRole = AssetTypeOperationalRole.GENERIC;
@IsArray()
@ArrayUnique()
@IsUUID('4', { each: true })
allowedParentTypeIds!: string[];
}
@@ -0,0 +1,67 @@
import { Transform } from 'class-transformer';
import {
IsEnum,
IsObject,
IsOptional,
IsString,
IsUUID,
Matches,
MaxLength,
MinLength,
} from 'class-validator';
import { AssetInformationStatus } from '../../database/entities';
export class CreateAssetDto {
@Transform(({ value }) =>
typeof value === 'string' ? value.trim().toUpperCase() : value,
)
@IsString()
@MinLength(1)
@MaxLength(120)
@Matches(/^[A-Z0-9][A-Z0-9._/-]*$/)
code!: string;
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MinLength(1)
@MaxLength(200)
name!: string;
@IsOptional()
@Transform(({ value }) =>
typeof value === 'string' && value.trim() ? value.trim() : null,
)
@IsString()
@MaxLength(200)
commonName?: string | null;
@IsUUID('4')
typeId!: string;
@IsOptional()
@IsUUID('4')
parentId?: string | null;
@IsOptional()
@IsUUID('4')
operationalAreaId?: string | null;
@IsOptional()
@IsUUID('4')
operatorCompanyId?: string | null;
@IsOptional()
@Transform(({ value }) =>
typeof value === 'string' && value.trim() ? value.trim() : null,
)
@IsString()
@MaxLength(4000)
description?: string | null;
@IsOptional()
@IsEnum(AssetInformationStatus)
informationStatus = AssetInformationStatus.DRAFT;
@IsObject()
attributes!: Record<string, unknown>;
}
@@ -0,0 +1,63 @@
import { Transform } from 'class-transformer';
import {
ArrayUnique,
IsArray,
IsBoolean,
IsEnum,
IsInt,
IsOptional,
IsString,
Matches,
Max,
MaxLength,
Min,
MinLength,
ValidateIf,
} from 'class-validator';
import { AssetAttributeDataType } from '../../database/entities';
export class CreateAttributeDefinitionDto {
@Transform(({ value }) =>
typeof value === 'string' ? value.trim().toLowerCase() : value,
)
@IsString()
@MinLength(2)
@MaxLength(80)
@Matches(/^[a-z][a-z0-9_-]+$/)
code!: string;
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MinLength(1)
@MaxLength(160)
name!: string;
@IsEnum(AssetAttributeDataType)
dataType!: AssetAttributeDataType;
@IsBoolean()
isRequired!: boolean;
@IsOptional()
@Transform(({ value }) =>
typeof value === 'string' && value.trim() ? value.trim() : null,
)
@IsString()
@MaxLength(40)
unit?: string | null;
@ValidateIf((dto: CreateAttributeDefinitionDto) =>
dto.dataType === AssetAttributeDataType.SELECT,
)
@IsArray()
@ArrayUnique()
@IsString({ each: true })
@MinLength(1, { each: true })
@MaxLength(160, { each: true })
options?: string[];
@IsInt()
@Min(0)
@Max(10_000)
sortOrder!: number;
}
@@ -0,0 +1,2 @@
import { Transform } from 'class-transformer'; import { IsDateString,IsOptional,IsString,IsUUID,Matches,MaxLength,MinLength } from 'class-validator';
export class CreateExternalIdentifierDto { @Transform(({value})=>typeof value==='string'?value.trim().toUpperCase():value) @IsString() @Matches(/^[A-Z0-9][A-Z0-9._/-]{1,79}$/) namespace!:string; @Transform(({value})=>typeof value==='string'?value.trim():value) @IsString() @MinLength(1) @MaxLength(180) value!:string; @IsOptional() @IsDateString() validFrom?:string|null; @IsOptional() @IsUUID('4') sourceDocumentId?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(2000) notes?:string|null; }
@@ -0,0 +1,53 @@
import { Transform } from 'class-transformer';
import { IsObject, IsOptional, IsString, IsUUID, Matches, MaxLength, MinLength } from 'class-validator';
export class CreateFieldDiscoveryDto {
@IsUUID('4')
visitId!: string;
@Transform(({ value }) => typeof value === 'string' ? value.trim().toUpperCase() : value)
@IsString()
@MinLength(1)
@MaxLength(120)
@Matches(/^[A-Z0-9][A-Z0-9._/-]*$/)
code!: string;
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
@IsString()
@MinLength(1)
@MaxLength(200)
name!: string;
@IsOptional()
@Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null)
@IsString()
@MaxLength(200)
commonName?: string | null;
@IsUUID('4')
typeId!: string;
@IsUUID('4')
parentId!: string;
@IsUUID('4')
operationalAreaId!: string;
@IsUUID('4')
operatorCompanyId!: string;
@IsOptional()
@Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null)
@IsString()
@MaxLength(4000)
description?: string | null;
@IsOptional()
@Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null)
@IsString()
@MaxLength(4000)
discoveryNotes?: string | null;
@IsObject()
attributes!: Record<string, unknown>;
}
@@ -0,0 +1,2 @@
import { Transform } from 'class-transformer'; import { IsDateString,IsEnum,IsOptional,IsString,MaxLength,MinLength } from 'class-validator'; import { SourceDocumentType } from '../../database/entities';
export class CreateSourceDocumentDto { @IsEnum(SourceDocumentType) documentType!:SourceDocumentType; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(160) documentNumber?:string|null; @Transform(({value})=>typeof value==='string'?value.trim():value) @IsString() @MinLength(3) @MaxLength(300) title!:string; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(240) issuer?:string|null; @IsOptional() @IsDateString() documentDate?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(500) externalReference?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(4000) notes?:string|null; }
@@ -0,0 +1,10 @@
import { Transform } from 'class-transformer';
import { IsString, MaxLength, MinLength } from 'class-validator';
export class EndAreaCompanyRelationDto {
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MinLength(3)
@MaxLength(1000)
reason!: string;
}
@@ -0,0 +1 @@
import { Transform } from 'class-transformer'; import { IsDateString,IsOptional,IsString,MaxLength,MinLength } from 'class-validator'; export class EndAreaLegalRightOrganizationDto { @IsOptional() @IsDateString() validUntil?:string|null; @Transform(({value})=>typeof value==='string'?value.trim():value) @IsString() @MinLength(3) @MaxLength(1000) reason!:string; }
@@ -0,0 +1 @@
import { Transform } from 'class-transformer'; import { IsString,MaxLength,MinLength } from 'class-validator'; export class EndExternalIdentifierDto { @Transform(({value})=>typeof value==='string'?value.trim():value) @IsString() @MinLength(3) @MaxLength(1000) reason!:string; }
@@ -0,0 +1 @@
import { Transform } from 'class-transformer'; import { IsDateString,IsOptional,IsString,MaxLength,MinLength } from 'class-validator'; export class EndOrganizationMembershipDto { @IsOptional() @IsDateString() validUntil?:string|null; @Transform(({value})=>typeof value==='string'?value.trim():value) @IsString() @MinLength(3) @MaxLength(1000) reason!:string; }
@@ -0,0 +1,2 @@
import { Transform } from 'class-transformer'; import { IsEnum,IsOptional,IsString,MaxLength } from 'class-validator'; import { AssetSourceDocumentRelationType } from '../../database/entities';
export class LinkAssetSourceDocumentDto { @IsEnum(AssetSourceDocumentRelationType) relationType:AssetSourceDocumentRelationType=AssetSourceDocumentRelationType.SOURCE; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(2000) notes?:string|null; }
@@ -0,0 +1,17 @@
import { Transform } from 'class-transformer';
import { IsBoolean, IsOptional, IsUUID } from 'class-validator';
export class ListAreaCompanyRelationsQueryDto {
@IsOptional()
@IsUUID('4')
areaId?: string;
@IsOptional()
@IsUUID('4')
companyId?: string;
@IsOptional()
@Transform(({ value }) => value === true || value === 'true' || value === '1')
@IsBoolean()
includeHistory = false;
}
@@ -0,0 +1,16 @@
import { Type } from 'class-transformer';
import { IsInt, IsOptional, IsUUID, Max, Min } from 'class-validator';
import { ListAssetTreeQueryDto } from './list-asset-tree-query.dto';
export class ListAssetTreeChildrenQueryDto extends ListAssetTreeQueryDto {
@IsOptional()
@IsUUID('4')
parentId?: string;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(200)
limit = 100;
}
@@ -0,0 +1,40 @@
import { Transform } from 'class-transformer';
import { IsBoolean, IsEnum, IsOptional, IsString, IsUUID, MaxLength } from 'class-validator';
import { AssetInformationStatus, AssetOperationalStatus } from '../../database/entities';
export class ListAssetTreeQueryDto {
@IsOptional()
@IsString()
@MaxLength(200)
search?: string;
@IsOptional()
@IsUUID('4')
typeId?: string;
@IsOptional()
@IsEnum(AssetInformationStatus)
status?: AssetInformationStatus;
@IsOptional()
@IsEnum(AssetOperationalStatus)
operationalStatus?: AssetOperationalStatus;
@IsOptional()
@IsUUID('4')
operationalAreaId?: string;
@IsOptional()
@IsUUID('4')
operatorCompanyId?: string;
@IsOptional()
@Transform(({ value }) => value === 'true' ? true : value === 'false' ? false : value)
@IsBoolean()
needsValidation?: boolean;
@IsOptional()
@Transform(({ value }) => value === 'true' ? true : value === 'false' ? false : value)
@IsBoolean()
hasGeometry?: boolean;
}
@@ -0,0 +1,62 @@
import { Transform, Type } from 'class-transformer';
import {
IsEnum,
IsInt,
IsISO8601,
IsOptional,
IsString,
IsUUID,
Max,
MaxLength,
Min,
} from 'class-validator';
import {
AssetInformationStatus,
AssetVersionChangeType,
} from '../../database/entities';
const trim = ({ value }: { value: unknown }) =>
typeof value === 'string' ? value.trim() : value;
export class AssetVersionPageQueryDto {
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
page = 1;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(100)
pageSize = 25;
}
export class ListAssetVersionsQueryDto extends AssetVersionPageQueryDto {
@Transform(trim)
@IsOptional()
@IsString()
@MaxLength(200)
search?: string;
@IsOptional()
@IsUUID('4')
typeId?: string;
@IsOptional()
@IsEnum(AssetInformationStatus)
status?: AssetInformationStatus;
@IsOptional()
@IsEnum(AssetVersionChangeType)
changeType?: AssetVersionChangeType;
@IsOptional()
@IsISO8601({ strict: true })
from?: string;
@IsOptional()
@IsISO8601({ strict: true })
to?: string;
}
@@ -0,0 +1,68 @@
import { Transform, Type } from 'class-transformer';
import {
IsBoolean,
IsEnum,
IsInt,
IsOptional,
IsString,
IsUUID,
Max,
MaxLength,
Min,
} from 'class-validator';
import { AssetInformationStatus, AssetOperationalStatus } from '../../database/entities';
export class ListAssetsQueryDto {
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
page = 1;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(100)
pageSize = 25;
@IsOptional()
@IsString()
@MaxLength(200)
search?: string;
@IsOptional()
@IsUUID('4')
typeId?: string;
@IsOptional()
@IsEnum(AssetInformationStatus)
status?: AssetInformationStatus;
@IsOptional()
@IsEnum(AssetOperationalStatus)
operationalStatus?: AssetOperationalStatus;
@IsOptional()
@Transform(({ value }) => value === 'true' ? true : value === 'false' ? false : value)
@IsBoolean()
needsValidation?: boolean;
@IsOptional()
@Transform(({ value }) => value === 'true' ? true : value === 'false' ? false : value)
@IsBoolean()
hasGeometry?: boolean;
@IsOptional()
@IsUUID('4')
parentId?: string;
@IsOptional()
@IsUUID('4')
operationalAreaId?: string;
@IsOptional()
@IsUUID('4')
operatorCompanyId?: string;
}
@@ -0,0 +1,26 @@
import { Transform } from 'class-transformer';
import { IsIn, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';
export class ListFieldDiscoveriesQueryDto {
@IsOptional()
@IsIn(['PENDING', 'APPROVED', 'MATCHED', 'REJECTED'])
status?: 'PENDING' | 'APPROVED' | 'MATCHED' | 'REJECTED';
@IsOptional()
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
@IsString()
search?: string;
@IsOptional()
@Transform(({ value }) => Number(value ?? 1))
@IsInt()
@Min(1)
page = 1;
@IsOptional()
@Transform(({ value }) => Number(value ?? 25))
@IsInt()
@Min(1)
@Max(100)
pageSize = 25;
}
@@ -0,0 +1,7 @@
import { IsOptional, IsUUID } from 'class-validator';
export class ListOperationalAreasQueryDto {
@IsOptional()
@IsUUID('4')
parentId?: string;
}
@@ -0,0 +1,50 @@
import { Transform, Type } from 'class-transformer';
import {
IsEnum,
IsInt,
IsISO8601,
IsOptional,
IsString,
IsUUID,
Max,
MaxLength,
Min,
} from 'class-validator';
import { AssetInformationStatus } from '../../database/entities';
const trim = ({ value }: { value: unknown }) =>
typeof value === 'string' ? value.trim() : value;
export class TemporalAtQueryDto {
@IsISO8601({ strict: true })
at!: string;
}
export class ListTemporalAssetsQueryDto extends TemporalAtQueryDto {
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
page = 1;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(1)
@Max(100)
pageSize = 25;
@Transform(trim)
@IsOptional()
@IsString()
@MaxLength(200)
search?: string;
@IsOptional()
@IsUUID('4')
typeId?: string;
@IsOptional()
@IsEnum(AssetInformationStatus)
status?: AssetInformationStatus;
}
@@ -0,0 +1,24 @@
import { IsEnum, IsOptional, IsString, IsUUID, Matches } from 'class-validator';
import {
AssetGeometryType,
AssetInformationStatus,
} from '../../database/entities';
export class MapAssetsQueryDto {
@IsOptional()
@IsString()
@Matches(/^-?\d+(?:\.\d+)?,-?\d+(?:\.\d+)?,-?\d+(?:\.\d+)?,-?\d+(?:\.\d+)?$/)
bbox?: string;
@IsOptional()
@IsUUID('4')
typeId?: string;
@IsOptional()
@IsEnum(AssetInformationStatus)
status?: AssetInformationStatus;
@IsOptional()
@IsEnum(AssetGeometryType)
geometryType?: AssetGeometryType;
}
@@ -0,0 +1,15 @@
import { IsOptional, IsString, IsUUID, MaxLength } from 'class-validator';
export class ParentOptionsQueryDto {
@IsUUID('4')
childTypeId!: string;
@IsOptional()
@IsUUID('4')
assetId?: string;
@IsOptional()
@IsString()
@MaxLength(200)
search?: string;
}
@@ -0,0 +1,29 @@
import { Transform } from 'class-transformer';
import { IsOptional, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
export class ReviewFieldDiscoveryDto {
@IsOptional()
@Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null)
@IsString()
@MaxLength(4000)
notes?: string | null;
}
export class RejectFieldDiscoveryDto {
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
@IsString()
@MinLength(5)
@MaxLength(4000)
reason!: string;
}
export class MatchFieldDiscoveryDto {
@IsUUID('4')
matchedAssetId!: string;
@Transform(({ value }) => typeof value === 'string' ? value.trim() : value)
@IsString()
@MinLength(5)
@MaxLength(4000)
reason!: string;
}
@@ -0,0 +1,2 @@
import { Transform } from 'class-transformer'; import { IsDateString,IsEnum,IsOptional,IsString,IsUUID,MaxLength,MinLength } from 'class-validator'; import { AreaLegalRightStatus } from '../../database/entities';
export class UpdateAreaLegalRightDto { @IsOptional() @Transform(({value})=>typeof value==='string'?value.trim():value) @IsString() @MinLength(3) @MaxLength(260) name?:string; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(180) instrumentNumber?:string|null; @IsOptional() @IsDateString() validFrom?:string|null; @IsOptional() @IsDateString() validUntil?:string|null; @IsOptional() @IsEnum(AreaLegalRightStatus) status?:AreaLegalRightStatus; @IsOptional() @IsUUID('4') sourceDocumentId?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(4000) notes?:string|null; @Transform(({value})=>typeof value==='string'?value.trim():value) @IsString() @MinLength(3) @MaxLength(1000) reason!:string; }
@@ -0,0 +1,47 @@
import { Type } from 'class-transformer';
import {
IsISO8601,
IsNumber,
IsOptional,
IsString,
Max,
MaxLength,
Min,
} from 'class-validator';
export class UpdateAssetMediaDto {
@IsOptional()
@IsString()
@MaxLength(200)
title?: string | null;
@IsOptional()
@IsString()
@MaxLength(4000)
description?: string | null;
@IsOptional()
@IsISO8601({ strict: true })
capturedAt?: string | null;
@IsOptional()
@Type(() => Number)
@IsNumber({ maxDecimalPlaces: 6 })
@Min(-90)
@Max(90)
latitude?: number | null;
@IsOptional()
@Type(() => Number)
@IsNumber({ maxDecimalPlaces: 6 })
@Min(-180)
@Max(180)
longitude?: number | null;
@IsOptional()
@Type(() => Number)
@IsNumber({ maxDecimalPlaces: 3 })
@Min(0)
@Max(100000)
accuracyM?: number | null;
}
@@ -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;
}
@@ -0,0 +1,46 @@
import { Transform } from 'class-transformer';
import {
ArrayUnique,
IsArray,
IsBoolean,
IsEnum,
IsOptional,
IsString,
IsUUID,
MaxLength,
MinLength,
} from 'class-validator';
import { AssetTypeOperationalRole } from '../../database/entities';
export class UpdateAssetTypeDto {
@IsOptional()
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MinLength(1)
@MaxLength(160)
name?: string;
@IsOptional()
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MaxLength(2000)
description?: string;
@IsOptional()
@IsBoolean()
canBeRoot?: boolean;
@IsOptional()
@IsBoolean()
isActive?: boolean;
@IsOptional()
@IsEnum(AssetTypeOperationalRole)
operationalRole?: AssetTypeOperationalRole;
@IsOptional()
@IsArray()
@ArrayUnique()
@IsUUID('4', { each: true })
allowedParentTypeIds?: string[];
}
@@ -0,0 +1,65 @@
import { Transform } from 'class-transformer';
import {
IsObject,
IsOptional,
IsString,
IsUUID,
Matches,
MaxLength,
MinLength,
} from 'class-validator';
export class UpdateAssetDto {
@IsOptional()
@IsUUID('4')
typeId?: string;
@IsOptional()
@Transform(({ value }) =>
typeof value === 'string' ? value.trim().toUpperCase() : value,
)
@IsString()
@MinLength(1)
@MaxLength(120)
@Matches(/^[A-Z0-9][A-Z0-9._/-]*$/)
code?: string;
@IsOptional()
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MinLength(1)
@MaxLength(200)
name?: string;
@IsOptional()
@Transform(({ value }) =>
typeof value === 'string' && value.trim() ? value.trim() : null,
)
@IsString()
@MaxLength(200)
commonName?: string | null;
@IsOptional()
@IsUUID('4')
parentId?: string | null;
@IsOptional()
@IsUUID('4')
operationalAreaId?: string | null;
@IsOptional()
@IsUUID('4')
operatorCompanyId?: string | null;
@IsOptional()
@Transform(({ value }) =>
typeof value === 'string' && value.trim() ? value.trim() : null,
)
@IsString()
@MaxLength(4000)
description?: string | null;
@IsOptional()
@IsObject()
attributes?: Record<string, unknown>;
}
@@ -0,0 +1,58 @@
import { Transform } from 'class-transformer';
import {
ArrayUnique,
IsArray,
IsBoolean,
IsEnum,
IsInt,
IsOptional,
IsString,
Max,
MaxLength,
Min,
MinLength,
} from 'class-validator';
import { AssetAttributeDataType } from '../../database/entities';
export class UpdateAttributeDefinitionDto {
@IsOptional()
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
@IsString()
@MinLength(1)
@MaxLength(160)
name?: string;
@IsOptional()
@IsEnum(AssetAttributeDataType)
dataType?: AssetAttributeDataType;
@IsOptional()
@IsBoolean()
isRequired?: boolean;
@IsOptional()
@IsBoolean()
isActive?: boolean;
@IsOptional()
@Transform(({ value }) =>
typeof value === 'string' && value.trim() ? value.trim() : null,
)
@IsString()
@MaxLength(40)
unit?: string | null;
@IsOptional()
@IsArray()
@ArrayUnique()
@IsString({ each: true })
@MinLength(1, { each: true })
@MaxLength(160, { each: true })
options?: string[] | null;
@IsOptional()
@IsInt()
@Min(0)
@Max(10_000)
sortOrder?: number;
}
@@ -0,0 +1,44 @@
import { Type } from 'class-transformer';
import {
IsArray,
IsEnum,
IsISO8601,
IsNumber,
IsOptional,
IsString,
Max,
MaxLength,
Min,
ValidateNested,
} from 'class-validator';
import { AssetGeometryType } from '../../database/entities';
export class AssetGeometryPayloadDto {
@IsEnum(AssetGeometryType)
type!: AssetGeometryType;
@IsArray()
coordinates!: unknown[];
}
export class UpsertAssetGeometryDto {
@ValidateNested()
@Type(() => AssetGeometryPayloadDto)
geometry!: AssetGeometryPayloadDto;
@IsOptional()
@Type(() => Number)
@IsNumber({ maxDecimalPlaces: 3 })
@Min(0)
@Max(100_000)
accuracyM?: number | null;
@IsOptional()
@IsISO8601({ strict: true })
capturedAt?: string | null;
@IsOptional()
@IsString()
@MaxLength(255)
deviceLabel?: string | null;
}
@@ -0,0 +1,2 @@
import { Transform } from 'class-transformer'; import { IsEmail,IsEnum,IsOptional,IsString,MaxLength } from 'class-validator'; import { OrganizationKind } from '../../database/entities';
export class UpsertOrganizationProfileDto { @IsEnum(OrganizationKind) organizationKind!:OrganizationKind; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(240) legalName?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(32) taxId?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim().toLowerCase():null) @IsEmail() @MaxLength(320) notificationEmail?:string|null; @IsOptional() @Transform(({value})=>typeof value==='string'&&value.trim()?value.trim():null) @IsString() @MaxLength(4000) notes?:string|null; }