route tests

This commit is contained in:
sbriat
2023-08-21 17:14:22 +02:00
parent dad964b39c
commit 65dd8d64b1
3 changed files with 69 additions and 15 deletions

View File

@@ -43,7 +43,6 @@ export type Path = {
export type Point = {
lon: number;
lat: number;
context?: PointContext;
};
export type SpacetimePoint = Point & {
@@ -56,14 +55,6 @@ export enum Role {
PASSENGER = 'PASSENGER',
}
export enum PointContext {
HOUSE_NUMBER = 'HOUSE_NUMBER',
STREET_ADDRESS = 'STREET_ADDRESS',
LOCALITY = 'LOCALITY',
VENUE = 'VENUE',
OTHER = 'OTHER',
}
export enum PathType {
GENERIC = 'generic',
DRIVER = 'driver',

View File

@@ -3,7 +3,6 @@ import {
ArgumentOutOfRangeException,
ValueObject,
} from '@mobicoop/ddd-library';
import { PointContext } from '../route.types';
/** Note:
* Value Objects with multiple properties can contain
@@ -14,7 +13,6 @@ export interface WaypointProps {
position: number;
lon: number;
lat: number;
context?: PointContext;
}
export class Waypoint extends ValueObject<WaypointProps> {
@@ -30,10 +28,6 @@ export class Waypoint extends ValueObject<WaypointProps> {
return this.props.lat;
}
get context(): PointContext {
return this.props.context;
}
protected validate(props: WaypointProps): void {
if (props.position < 0)
throw new ArgumentInvalidException(