fixed bad ad mapping

This commit is contained in:
sbriat
2023-09-12 14:40:16 +02:00
parent 2058bfce4c
commit 1939f62049
13 changed files with 238 additions and 144 deletions

View File

@@ -29,47 +29,4 @@ export class RouteEntity extends AggregateRoot<RouteProps> {
validate(): void {
// entity business rules validation to protect it's invariant before saving entity to a database
}
// private static getPaths = (
// roles: Role[],
// waypoints: WaypointProps[],
// ): Path[] => {
// const paths: Path[] = [];
// if (roles.includes(Role.DRIVER) && roles.includes(Role.PASSENGER)) {
// if (waypoints.length == 2) {
// // 2 points => same route for driver and passenger
// paths.push(this.createGenericPath(waypoints));
// } else {
// paths.push(
// this.createDriverPath(waypoints),
// this.createPassengerPath(waypoints),
// );
// }
// } else if (roles.includes(Role.DRIVER)) {
// paths.push(this.createDriverPath(waypoints));
// } else if (roles.includes(Role.PASSENGER)) {
// paths.push(this.createPassengerPath(waypoints));
// }
// return paths;
// };
// private static createGenericPath = (waypoints: WaypointProps[]): Path =>
// this.createPath(waypoints, PathType.GENERIC);
// private static createDriverPath = (waypoints: WaypointProps[]): Path =>
// this.createPath(waypoints, PathType.DRIVER);
// private static createPassengerPath = (waypoints: WaypointProps[]): Path =>
// this.createPath(
// [waypoints[0], waypoints[waypoints.length - 1]],
// PathType.PASSENGER,
// );
// private static createPath = (
// points: WaypointProps[],
// type: PathType,
// ): Path => ({
// type,
// points,
// });
}

View File

@@ -45,5 +45,3 @@ export type Spacetime = {
};
export type Step = Point & Spacetime;
export type Waystep = Waypoint & Spacetime;