mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
update ApiBasedShuttleRepositoryLoader with timestamps
This commit is contained in:
@@ -73,6 +73,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
id: jsonRoute.myid,
|
id: jsonRoute.myid,
|
||||||
polylineCoordinates: [],
|
polylineCoordinates: [],
|
||||||
systemId: this.systemIdForConstructedData,
|
systemId: this.systemIdForConstructedData,
|
||||||
|
updatedTimeMs: Date.now(),
|
||||||
};
|
};
|
||||||
|
|
||||||
await this.repository.addOrUpdateRoute(constructedRoute);
|
await this.repository.addOrUpdateRoute(constructedRoute);
|
||||||
@@ -172,7 +173,8 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
routeId: jsonBus.routeId,
|
routeId: jsonBus.routeId,
|
||||||
systemId: this.systemIdForConstructedData,
|
systemId: this.systemIdForConstructedData,
|
||||||
id: `${jsonBus.busId}`,
|
id: `${jsonBus.busId}`,
|
||||||
orientationInDegrees: parseFloat(jsonBus.calculatedCourse)
|
orientationInDegrees: parseFloat(jsonBus.calculatedCourse),
|
||||||
|
updatedTimeMs: Date.now(),
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.repository.addOrUpdateShuttle(constructedShuttle);
|
await this.repository.addOrUpdateShuttle(constructedShuttle);
|
||||||
@@ -249,6 +251,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
latitude: parseFloat(stop.latitude),
|
latitude: parseFloat(stop.latitude),
|
||||||
longitude: parseFloat(stop.longitude),
|
longitude: parseFloat(stop.longitude),
|
||||||
},
|
},
|
||||||
|
updatedTimeMs: Date.now(),
|
||||||
};
|
};
|
||||||
|
|
||||||
await this.repository.addOrUpdateStop(constructedStop);
|
await this.repository.addOrUpdateStop(constructedStop);
|
||||||
@@ -280,6 +283,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
stopId,
|
stopId,
|
||||||
position: index + 1,
|
position: index + 1,
|
||||||
systemId: this.systemIdForConstructedData,
|
systemId: this.systemIdForConstructedData,
|
||||||
|
updatedTimeMs: Date.now(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,6 +293,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
stopId: jsonOrderedStopData[index - 1][1],
|
stopId: jsonOrderedStopData[index - 1][1],
|
||||||
position: index,
|
position: index,
|
||||||
systemId: this.systemIdForConstructedData,
|
systemId: this.systemIdForConstructedData,
|
||||||
|
updatedTimeMs: Date.now(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (index < jsonOrderedStopData.length - 1) {
|
if (index < jsonOrderedStopData.length - 1) {
|
||||||
@@ -297,6 +302,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
|||||||
stopId: jsonOrderedStopData[index + 1][1],
|
stopId: jsonOrderedStopData[index + 1][1],
|
||||||
position: index + 2,
|
position: index + 2,
|
||||||
systemId: this.systemIdForConstructedData,
|
systemId: this.systemIdForConstructedData,
|
||||||
|
updatedTimeMs: Date.now(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user