diff --git a/server/src/geolocations/dto/create-geolocation.dto.ts b/server/src/geolocations/dto/create-geolocation.dto.ts index ed37331..13f0500 100644 --- a/server/src/geolocations/dto/create-geolocation.dto.ts +++ b/server/src/geolocations/dto/create-geolocation.dto.ts @@ -1,24 +1,40 @@ import { ApiProperty } from "@nestjs/swagger" +import { Type } from "class-transformer" +import { IsDate, IsLatitude, IsLongitude, IsNumber } from "class-validator" export class CreateGeolocationDto { - @ApiProperty({description: "Longitude en degrés"}) + @IsLongitude() + @Type(() => Number) + @ApiProperty({description: "Longitude en degrés", required: true}) longitude: number + @IsLatitude() + @Type(() => Number) @ApiProperty({description: "Latitude en degrés"}) latitude: number + @IsNumber() + @Type(() => Number) @ApiProperty({description: "Vitesse en mètres par seconde"}) speed: number + @IsNumber() + @Type(() => Number) @ApiProperty({description: "Précision en mètres de la position obtenue"}) accuracy: number + @IsNumber() + @Type(() => Number) @ApiProperty({description: "Altitude en mètres"}) altitude: number + @IsNumber() + @Type(() => Number) @ApiProperty({description: "Précision de l'altitude en mètres"}) altitudeAccuracy: number + @IsDate() + @Type(() => Date) @ApiProperty({description: "Date et heure de capture de la géolocalisation"}) timestamp: Date }