update ApiBasedShuttleRepositoryLoader with timestamps

This commit is contained in:
2025-04-29 16:11:41 -07:00
parent d529554d84
commit 563362b0b5

View File

@@ -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(),
}; };
} }