define a generic folder
This commit is contained in:
20
src/generic/dto/coordinate.dto.ts
Normal file
20
src/generic/dto/coordinate.dto.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { IsNotEmpty, IsLatitude, IsLongitude } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class CoordinateDto {
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The latitudinal component',
|
||||
example: 42.8402,
|
||||
})
|
||||
@IsLatitude()
|
||||
latitude: number;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The longitudinal component',
|
||||
example: 18.8402,
|
||||
})
|
||||
@IsLongitude()
|
||||
longitude: number;
|
||||
}
|
||||
19
src/generic/dto/waypoint.dto.ts
Normal file
19
src/generic/dto/waypoint.dto.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { IsNotEmpty } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { CoordinateDto } from './coordinate.dto';
|
||||
|
||||
export class WaypointDto {
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The unique waypoint code',
|
||||
example: 'KETAP',
|
||||
})
|
||||
identifier: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
@ApiProperty({
|
||||
description: 'The latitudinal component',
|
||||
example: 42.8402,
|
||||
})
|
||||
coordinate: CoordinateDto;
|
||||
}
|
||||
Reference in New Issue
Block a user