feat(observations): add dto

This commit is contained in:
admin-valentin 2026-07-31 10:45:00 +00:00
parent 4315e7f31f
commit 3cd2bdc82b

38
src/observations/dto.ts Normal file
View file

@ -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;
}