mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-19 08:50:29 +00:00
update test data with etas
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// Mock data
|
// Mock data
|
||||||
import { IOrderedStop, IRoute, IShuttle, IStop, ISystem, Repository } from "./repository";
|
import { IEta, IOrderedStop, IRoute, IShuttle, IStop, ISystem, Repository } from "./repository";
|
||||||
|
|
||||||
const systems: ISystem[] = [
|
const systems: ISystem[] = [
|
||||||
{
|
{
|
||||||
@@ -86,30 +86,18 @@ const shuttles: IShuttle[] = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
// const etas: Eta[] = [
|
const etas: IEta[] = [
|
||||||
// {
|
{
|
||||||
// stop: stops[0],
|
stopId: stops[0].id,
|
||||||
// shuttle: shuttles[0],
|
shuttleId: shuttles[0].id,
|
||||||
// secondsRemaining: 12.023,
|
secondsRemaining: 12.023,
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// stop: stops[1],
|
stopId: stops[1].id,
|
||||||
// shuttle: shuttles[0],
|
shuttleId: shuttles[0].id,
|
||||||
// secondsRemaining: 600.123,
|
secondsRemaining: 600.123,
|
||||||
// }
|
}
|
||||||
// ];
|
];
|
||||||
|
|
||||||
// shuttles[0].etas = etas;
|
|
||||||
//
|
|
||||||
// routes[0].shuttles = shuttles;
|
|
||||||
//
|
|
||||||
// systems[0].stops = stops;
|
|
||||||
// systems[0].routes = routes;
|
|
||||||
// systems[0].shuttles = shuttles;
|
|
||||||
|
|
||||||
// export function loadTestData(sharedMemory: SharedMemory) {
|
|
||||||
// sharedMemory.systems = systems;
|
|
||||||
// }
|
|
||||||
|
|
||||||
export async function loadTestData(repository: Repository) {
|
export async function loadTestData(repository: Repository) {
|
||||||
await Promise.all(systems.map(async (system) => {
|
await Promise.all(systems.map(async (system) => {
|
||||||
@@ -130,4 +118,7 @@ export async function loadTestData(repository: Repository) {
|
|||||||
await Promise.all(orderedStopsForTealRoute.map(async (orderedStop) => {
|
await Promise.all(orderedStopsForTealRoute.map(async (orderedStop) => {
|
||||||
await repository.addOrUpdateOrderedStop(orderedStop);
|
await repository.addOrUpdateOrderedStop(orderedStop);
|
||||||
}));
|
}));
|
||||||
|
await Promise.all(etas.map(async (eta) => {
|
||||||
|
await repository.addOrUpdateEta(eta);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user