diff --git a/src/observations/dto.ts b/src/observations/dto.ts new file mode 100644 index 0000000..d6cdf02 --- /dev/null +++ b/src/observations/dto.ts @@ -0,0 +1,38 @@ +import { IsISO8601, IsNumber, IsOptional, IsString, Length, Max, Min } from 'class-validator'; + +export class CreateObservationDto { + @IsString() + @Length(1, 64) + subjectType!: string; + + @IsString() + @Length(1, 255) + subjectId!: string; + + @IsString() + @Length(1, 128) + metric!: string; + + @IsString() + @Length(1, 1000) + value!: string; + + @IsOptional() + @IsString() + @Length(1, 32) + unit?: string; + + @IsString() + @Length(1, 128) + source!: string; + + @IsOptional() + @IsISO8601() + observedAt?: string; + + @IsOptional() + @IsNumber() + @Min(0) + @Max(1) + confidence?: number; +}