63 lines
1.4 KiB
TypeScript
63 lines
1.4 KiB
TypeScript
import { CreateAdProps, Frequency } from '@modules/ad/core/domain/ad.types';
|
|
import { PointProps } from '@modules/ad/core/domain/value-objects/point.value-object';
|
|
import { ScheduleItemProps } from '@modules/ad/core/domain/value-objects/schedule-item.value-object';
|
|
|
|
export const Nice: PointProps = {
|
|
lat: 43.7102,
|
|
lon: 7.262,
|
|
};
|
|
|
|
export const Marseille: PointProps = {
|
|
lat: 43.2965,
|
|
lon: 5.3698,
|
|
};
|
|
|
|
export const SaintRaphael: PointProps = {
|
|
lat: 43.4268,
|
|
lon: 6.769,
|
|
};
|
|
|
|
export const Toulon: PointProps = {
|
|
lat: 43.1167,
|
|
lon: 5.95,
|
|
};
|
|
|
|
export function wednesday(time: string): ScheduleItemProps {
|
|
return { day: 3, time: time, margin: 900 };
|
|
}
|
|
|
|
export function weekdays(time: string): ScheduleItemProps[] {
|
|
return [1, 2, 3, 4, 5].map<ScheduleItemProps>((day) => ({
|
|
day: day,
|
|
time: time,
|
|
margin: 900,
|
|
}));
|
|
}
|
|
|
|
export function NiceMarseille(
|
|
frequency: Frequency,
|
|
dates: string[],
|
|
schedule: ScheduleItemProps[],
|
|
): CreateAdProps {
|
|
return {
|
|
id: 'b4b56444-f8d3-4110-917c-e37bba77f383',
|
|
driver: true,
|
|
passenger: false,
|
|
frequency: frequency,
|
|
fromDate: dates[0],
|
|
toDate: dates[1],
|
|
schedule: schedule,
|
|
seatsProposed: 3,
|
|
seatsRequested: 1,
|
|
strict: false,
|
|
waypoints: [Nice, Marseille],
|
|
points: [Nice, SaintRaphael, Toulon, Marseille],
|
|
driverDuration: 7668,
|
|
driverDistance: 199000,
|
|
passengerDuration: 7668,
|
|
passengerDistance: 199000,
|
|
fwdAzimuth: 273,
|
|
backAzimuth: 93,
|
|
};
|
|
}
|