Correction validation création géolocalisation
This commit is contained in:
parent
7750c1b75c
commit
fc1773b5a6
@ -1,24 +1,40 @@
|
|||||||
import { ApiProperty } from "@nestjs/swagger"
|
import { ApiProperty } from "@nestjs/swagger"
|
||||||
|
import { Type } from "class-transformer"
|
||||||
|
import { IsDate, IsLatitude, IsLongitude, IsNumber } from "class-validator"
|
||||||
|
|
||||||
export class CreateGeolocationDto {
|
export class CreateGeolocationDto {
|
||||||
@ApiProperty({description: "Longitude en degrés"})
|
@IsLongitude()
|
||||||
|
@Type(() => Number)
|
||||||
|
@ApiProperty({description: "Longitude en degrés", required: true})
|
||||||
longitude: number
|
longitude: number
|
||||||
|
|
||||||
|
@IsLatitude()
|
||||||
|
@Type(() => Number)
|
||||||
@ApiProperty({description: "Latitude en degrés"})
|
@ApiProperty({description: "Latitude en degrés"})
|
||||||
latitude: number
|
latitude: number
|
||||||
|
|
||||||
|
@IsNumber()
|
||||||
|
@Type(() => Number)
|
||||||
@ApiProperty({description: "Vitesse en mètres par seconde"})
|
@ApiProperty({description: "Vitesse en mètres par seconde"})
|
||||||
speed: number
|
speed: number
|
||||||
|
|
||||||
|
@IsNumber()
|
||||||
|
@Type(() => Number)
|
||||||
@ApiProperty({description: "Précision en mètres de la position obtenue"})
|
@ApiProperty({description: "Précision en mètres de la position obtenue"})
|
||||||
accuracy: number
|
accuracy: number
|
||||||
|
|
||||||
|
@IsNumber()
|
||||||
|
@Type(() => Number)
|
||||||
@ApiProperty({description: "Altitude en mètres"})
|
@ApiProperty({description: "Altitude en mètres"})
|
||||||
altitude: number
|
altitude: number
|
||||||
|
|
||||||
|
@IsNumber()
|
||||||
|
@Type(() => Number)
|
||||||
@ApiProperty({description: "Précision de l'altitude en mètres"})
|
@ApiProperty({description: "Précision de l'altitude en mètres"})
|
||||||
altitudeAccuracy: number
|
altitudeAccuracy: number
|
||||||
|
|
||||||
|
@IsDate()
|
||||||
|
@Type(() => Date)
|
||||||
@ApiProperty({description: "Date et heure de capture de la géolocalisation"})
|
@ApiProperty({description: "Date et heure de capture de la géolocalisation"})
|
||||||
timestamp: Date
|
timestamp: Date
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user