chore: import DH V2 D5.6.4 production baseline
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsEnum, IsOptional, IsString, MaxLength } from 'class-validator';
|
||||
import { InspectionVisitStatus } from '../../database/entities';
|
||||
|
||||
export class ChangeInspectionVisitStatusDto {
|
||||
@IsEnum(InspectionVisitStatus)
|
||||
status!: InspectionVisitStatus;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) =>
|
||||
typeof value === 'string' && value.trim() ? value.trim() : null,
|
||||
)
|
||||
@IsString()
|
||||
@MaxLength(4000)
|
||||
reason?: string | null;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { IsISO8601, IsUUID } from 'class-validator';
|
||||
|
||||
export class CreateInspectionVisitDto {
|
||||
@IsUUID('4')
|
||||
operationalAreaId!: string;
|
||||
|
||||
@IsUUID('4')
|
||||
operatorCompanyId!: string;
|
||||
|
||||
@IsISO8601({ strict: true })
|
||||
plannedStartAt!: string;
|
||||
|
||||
@IsUUID('4')
|
||||
leadInspectorUserId!: string;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsString, MaxLength, MinLength } from 'class-validator';
|
||||
|
||||
export class ExcludeInspectionVisitAssetDto {
|
||||
@Transform(({ value }) => (typeof value === 'string' ? value.trim() : value))
|
||||
@IsString()
|
||||
@MinLength(10)
|
||||
@MaxLength(2000)
|
||||
reason!: string;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsEnum, IsInt, IsOptional, IsString, IsUUID, Matches, Max, MaxLength, Min } from 'class-validator';
|
||||
import { InspectionVisitStatus } from '../../database/entities';
|
||||
|
||||
export class ListInspectionVisitsQueryDto {
|
||||
@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()
|
||||
@IsEnum(InspectionVisitStatus)
|
||||
status?: InspectionVisitStatus;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID('4')
|
||||
companyId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID('4')
|
||||
areaId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID('4')
|
||||
inspectorId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
||||
dateFrom?: string;
|
||||
|
||||
@IsOptional()
|
||||
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
||||
dateTo?: string;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { ArrayMaxSize, ArrayUnique, IsArray, IsUUID } from 'class-validator';
|
||||
|
||||
export class ReplaceInspectionVisitAssetsDto {
|
||||
@IsArray()
|
||||
@ArrayMaxSize(500)
|
||||
@ArrayUnique()
|
||||
@IsUUID('4', { each: true })
|
||||
assetIds!: string[];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { ArrayMaxSize, ArrayUnique, IsArray, IsOptional, IsUUID } from 'class-validator';
|
||||
|
||||
export class ReplaceInspectionVisitTeamDto {
|
||||
@IsOptional()
|
||||
@IsUUID('4')
|
||||
leadInspectorUserId!: string | null;
|
||||
|
||||
@IsArray()
|
||||
@ArrayMaxSize(50)
|
||||
@ArrayUnique()
|
||||
@IsUUID('4', { each: true })
|
||||
memberUserIds!: string[];
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import {
|
||||
IsISO8601,
|
||||
IsOptional,
|
||||
IsString,
|
||||
IsUUID,
|
||||
MaxLength,
|
||||
} from 'class-validator';
|
||||
|
||||
export class UpdateInspectionVisitDto {
|
||||
@IsOptional()
|
||||
@Transform(({ value }) =>
|
||||
typeof value === 'string' && value.trim() ? value.trim() : null,
|
||||
)
|
||||
@IsString()
|
||||
@MaxLength(4000)
|
||||
objective?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID('4')
|
||||
scopeAssetId?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID('4')
|
||||
operationalAreaId?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsUUID('4')
|
||||
operatorCompanyId?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsISO8601({ strict: true })
|
||||
plannedStartAt?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@Transform(({ value }) =>
|
||||
typeof value === 'string' && value.trim() ? value.trim() : null,
|
||||
)
|
||||
@IsString()
|
||||
@MaxLength(4000)
|
||||
instructions?: string | null;
|
||||
}
|
||||
Reference in New Issue
Block a user