From aed83e9ad7dd469b073020a9592a39b27866b9c3 Mon Sep 17 00:00:00 2001 From: enlineawork Date: Sat, 5 Sep 2026 17:45:25 -0300 Subject: [PATCH] F2.1: metadatos GPS y EXIF para foto de campo --- .../dto/upload-field-inventory-photo.dto.ts | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 api-v3/src/inspection-visits/dto/upload-field-inventory-photo.dto.ts diff --git a/api-v3/src/inspection-visits/dto/upload-field-inventory-photo.dto.ts b/api-v3/src/inspection-visits/dto/upload-field-inventory-photo.dto.ts new file mode 100644 index 0000000..8101a12 --- /dev/null +++ b/api-v3/src/inspection-visits/dto/upload-field-inventory-photo.dto.ts @@ -0,0 +1,70 @@ +import { Transform, Type } from 'class-transformer'; +import { + IsISO8601, + IsNumber, + IsOptional, + IsString, + Max, + MaxLength, + Min, +} from 'class-validator'; + +export class UploadFieldInventoryPhotoDto { + @IsOptional() + @Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null) + @IsString() + @MaxLength(200) + title?: string | null; + + @IsOptional() + @Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null) + @IsString() + @MaxLength(4000) + description?: string | null; + + @Type(() => Number) + @IsNumber({ maxDecimalPlaces: 6 }) + @Min(-90) + @Max(90) + deviceLatitude!: number; + + @Type(() => Number) + @IsNumber({ maxDecimalPlaces: 6 }) + @Min(-180) + @Max(180) + deviceLongitude!: number; + + @IsOptional() + @Type(() => Number) + @IsNumber({ maxDecimalPlaces: 3 }) + @Min(0) + @Max(100000) + deviceAccuracyM?: number; + + @IsISO8601({ strict: true }) + deviceCapturedAt!: string; + + @IsOptional() + @Transform(({ value }) => typeof value === 'string' && value.trim() ? value.trim() : null) + @IsString() + @MaxLength(255) + deviceLabel?: string | null; + + @IsOptional() + @Type(() => Number) + @IsNumber({ maxDecimalPlaces: 6 }) + @Min(-90) + @Max(90) + exifLatitude?: number; + + @IsOptional() + @Type(() => Number) + @IsNumber({ maxDecimalPlaces: 6 }) + @Min(-180) + @Max(180) + exifLongitude?: number; + + @IsOptional() + @IsISO8601({ strict: true }) + exifCapturedAt?: string; +}