matcher/src/modules/geography/domain/entities/coordinates.ts

20 lines
351 B
TypeScript
Raw Normal View History

2023-04-26 12:14:46 +00:00
import { AutoMap } from '@automapper/classes';
2023-04-27 15:52:43 +00:00
import { IsLatitude, IsLongitude, IsNumber } from 'class-validator';
2023-04-26 12:14:46 +00:00
export class Coordinates {
constructor(lon: number, lat: number) {
this.lon = lon;
this.lat = lat;
}
@IsNumber()
2023-04-27 15:52:43 +00:00
@IsLongitude()
2023-04-26 12:14:46 +00:00
@AutoMap()
2023-04-26 10:10:22 +00:00
lon: number;
2023-04-26 12:14:46 +00:00
@IsNumber()
2023-04-27 15:52:43 +00:00
@IsLatitude()
2023-04-26 12:14:46 +00:00
@AutoMap()
2023-04-26 10:10:22 +00:00
lat: number;
2023-04-26 12:14:46 +00:00
}