flightstate.dto.ts 930 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { IsNotEmpty, IsInt, Min, Max } from 'class-validator';
  2. import { ApiProperty } from '@nestjs/swagger';
  3. import { CoordinateDto } from '../../generic/dto/coordinate.dto';
  4. export class FlightStateDto {
  5. @IsNotEmpty()
  6. @ApiProperty({
  7. description: 'The current position',
  8. })
  9. position: CoordinateDto;
  10. @IsNotEmpty()
  11. @ApiProperty({
  12. description: 'The reported ground speed',
  13. example: 400,
  14. })
  15. @IsInt()
  16. @Min(0)
  17. @Max(700)
  18. groundSpeed: number;
  19. @IsNotEmpty()
  20. @ApiProperty({
  21. description: 'The reported ground track',
  22. example: 400,
  23. })
  24. @IsInt()
  25. @Min(0)
  26. @Max(360)
  27. groundTrack: number;
  28. @IsNotEmpty()
  29. @ApiProperty({
  30. description: 'The reported altitude',
  31. example: 30000,
  32. })
  33. @IsInt()
  34. @Min(0)
  35. @Max(60000)
  36. altitude: number;
  37. @IsNotEmpty()
  38. @ApiProperty({
  39. description: 'The reported vertical speed',
  40. example: 400,
  41. })
  42. @IsInt()
  43. verticalSpeed: number;
  44. }