20 lines
350 B
TypeScript
20 lines
350 B
TypeScript
import { AutoMap } from '@automapper/classes';
|
|
import { IsLatitude, IsLongitude, IsNumber } from 'class-validator';
|
|
|
|
export class Coordinate {
|
|
constructor(lon: number, lat: number) {
|
|
this.lon = lon;
|
|
this.lat = lat;
|
|
}
|
|
|
|
@IsNumber()
|
|
@IsLongitude()
|
|
@AutoMap()
|
|
lon: number;
|
|
|
|
@IsNumber()
|
|
@IsLatitude()
|
|
@AutoMap()
|
|
lat: number;
|
|
}
|