mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
change updatedTime into a Date
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export interface IEntityWithTimestamp {
|
||||
updatedTimeMs: number;
|
||||
updatedTime: Date;
|
||||
}
|
||||
|
||||
export interface IEntityWithId {
|
||||
|
||||
@@ -59,7 +59,7 @@ export class ChapmanApiBasedParkingRepositoryLoader implements ParkingRepository
|
||||
name: jsonStructure.Name,
|
||||
spotsAvailable: jsonStructure.CurrentCount > jsonStructure.Capacity ? jsonStructure.Capacity : jsonStructure.CurrentCount,
|
||||
address: jsonStructure.Address,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
}
|
||||
|
||||
return structureToReturn;
|
||||
|
||||
@@ -12,7 +12,7 @@ const parkingStructures: IParkingStructure[] = [
|
||||
},
|
||||
name: "Anderson Structure",
|
||||
id: "1",
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
address: "200 W Sycamore Ave, Orange, CA 92866-1053",
|
||||
@@ -24,7 +24,7 @@ const parkingStructures: IParkingStructure[] = [
|
||||
},
|
||||
name: "Barrera",
|
||||
id: "2",
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
||||
id: jsonRoute.myid,
|
||||
polylineCoordinates: [],
|
||||
systemId: this.systemIdForConstructedData,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
};
|
||||
|
||||
await this.repository.addOrUpdateRoute(constructedRoute);
|
||||
@@ -174,7 +174,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
||||
systemId: this.systemIdForConstructedData,
|
||||
id: `${jsonBus.busId}`,
|
||||
orientationInDegrees: parseFloat(jsonBus.calculatedCourse),
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
}
|
||||
|
||||
await this.repository.addOrUpdateShuttle(constructedShuttle);
|
||||
@@ -223,7 +223,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
||||
secondsRemaining: jsonEta.secondsSpent,
|
||||
shuttleId: `${shuttleId}`,
|
||||
stopId: stopId,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
systemId: this.systemIdForConstructedData,
|
||||
};
|
||||
|
||||
@@ -251,7 +251,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
||||
latitude: parseFloat(stop.latitude),
|
||||
longitude: parseFloat(stop.longitude),
|
||||
},
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
};
|
||||
|
||||
await this.repository.addOrUpdateStop(constructedStop);
|
||||
@@ -283,7 +283,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
||||
stopId,
|
||||
position: index + 1,
|
||||
systemId: this.systemIdForConstructedData,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
||||
stopId: jsonOrderedStopData[index - 1][1],
|
||||
position: index,
|
||||
systemId: this.systemIdForConstructedData,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
};
|
||||
}
|
||||
if (index < jsonOrderedStopData.length - 1) {
|
||||
@@ -302,7 +302,7 @@ export class ApiBasedShuttleRepositoryLoader implements ShuttleRepositoryLoader
|
||||
stopId: jsonOrderedStopData[index + 1][1],
|
||||
position: index + 2,
|
||||
systemId: this.systemIdForConstructedData,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4324,7 +4324,7 @@ const routes: IRoute[] = [
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
polylineCoordinates: redRoutePolylineCoordinates,
|
||||
color: "#db2316",
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
name: "Teal Route",
|
||||
@@ -4332,7 +4332,7 @@ const routes: IRoute[] = [
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
polylineCoordinates: tealRoutePolylineCoordinates,
|
||||
color: "#21bdd1",
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -4345,7 +4345,7 @@ const stops: IStop[] = [
|
||||
longitude: -117.8892805,
|
||||
},
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
@@ -4355,7 +4355,7 @@ const stops: IStop[] = [
|
||||
longitude: -117.895966,
|
||||
},
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
@@ -4365,7 +4365,7 @@ const stops: IStop[] = [
|
||||
"longitude": -117.85281
|
||||
},
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
}
|
||||
];
|
||||
|
||||
@@ -4375,14 +4375,14 @@ const orderedStopsForRedRoute: IOrderedStop[] = [
|
||||
stopId: stops[0].id,
|
||||
position: 1,
|
||||
systemId: "1",
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
routeId: routes[0].id,
|
||||
stopId: stops[2].id,
|
||||
position: 2,
|
||||
systemId: "1",
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -4392,21 +4392,21 @@ const orderedStopsForTealRoute: IOrderedStop[] = [
|
||||
stopId: stops[0].id,
|
||||
position: 1,
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
routeId: routes[1].id,
|
||||
stopId: stops[1].id,
|
||||
position: 2,
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
routeId: routes[1].id,
|
||||
stopId: stops[2].id,
|
||||
position: 2,
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
]
|
||||
|
||||
@@ -4426,7 +4426,7 @@ const shuttles: IShuttle[] = [
|
||||
routeId: routes[0].id,
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
orientationInDegrees: 45.91,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
name: "24",
|
||||
@@ -4438,7 +4438,7 @@ const shuttles: IShuttle[] = [
|
||||
routeId: routes[0].id,
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
orientationInDegrees: 90.24,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
}
|
||||
];
|
||||
|
||||
@@ -4448,28 +4448,28 @@ const etas: IEta[] = [
|
||||
shuttleId: shuttles[0].id,
|
||||
secondsRemaining: 12.023,
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
stopId: stops[2].id,
|
||||
shuttleId: shuttles[0].id,
|
||||
secondsRemaining: 600.123,
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
stopId: stops[2].id,
|
||||
shuttleId: shuttles[1].id,
|
||||
secondsRemaining: 172.015,
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
},
|
||||
{
|
||||
stopId: stops[0].id,
|
||||
shuttleId: shuttles[1].id,
|
||||
secondsRemaining: 710.152,
|
||||
systemId: supportedIntegrationTestSystems[0].id,
|
||||
updatedTimeMs: Date.now(),
|
||||
updatedTime: Date.now(),
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export const OrderedStopResolvers: Resolvers<ServerContext> = {
|
||||
routeId: parent.routeId,
|
||||
stopId: nextOrderedStopObject.id,
|
||||
systemId: system.id,
|
||||
updatedTime: nextOrderedStopObject.updatedTimeMs
|
||||
updatedTime: nextOrderedStopObject.updatedTime
|
||||
}
|
||||
},
|
||||
previousStop: async (parent, args, contextValue, _info): Promise<OrderedStop | null> => {
|
||||
@@ -48,7 +48,7 @@ export const OrderedStopResolvers: Resolvers<ServerContext> = {
|
||||
routeId: parent.routeId,
|
||||
stopId: previousOrderedStopObject.id,
|
||||
systemId: system.id,
|
||||
updatedTime: previousOrderedStopObject.updatedTimeMs,
|
||||
updatedTime: previousOrderedStopObject.updatedTime,
|
||||
}
|
||||
},
|
||||
stop: async (parent, args, contextValue, _info) => {
|
||||
|
||||
@@ -14,7 +14,7 @@ export const RouteResolvers: Resolvers<ServerContext> = {
|
||||
name,
|
||||
id,
|
||||
orientationInDegrees,
|
||||
updatedTimeMs
|
||||
updatedTime
|
||||
}) => ({
|
||||
coordinates: coordinates as Coordinates,
|
||||
name,
|
||||
@@ -23,7 +23,7 @@ export const RouteResolvers: Resolvers<ServerContext> = {
|
||||
id,
|
||||
orientationInDegrees,
|
||||
systemId: parent.systemId,
|
||||
updatedTimeMs,
|
||||
updatedTime: updatedTimeMs,
|
||||
}));
|
||||
},
|
||||
orderedStop: async (parent, args, contextValue, info) => {
|
||||
@@ -43,7 +43,7 @@ export const RouteResolvers: Resolvers<ServerContext> = {
|
||||
routeId: parent.id,
|
||||
route: parent,
|
||||
systemId: system.id,
|
||||
updatedTimeMs: orderedStop.updatedTimeMs,
|
||||
updatedTimeMs: orderedStop.updatedTime,
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
shuttleId: parent.id,
|
||||
shuttle: parent,
|
||||
systemId: system.id,
|
||||
updatedTimeMs: etaForStopId.updatedTimeMs,
|
||||
updatedTimeMs: etaForStopId.updatedTime,
|
||||
};
|
||||
},
|
||||
etas: async (parent, args, contextValue, info) => {
|
||||
@@ -32,7 +32,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
etasForShuttle.map(async ({
|
||||
secondsRemaining,
|
||||
stopId,
|
||||
updatedTimeMs
|
||||
updatedTime
|
||||
}): Promise<Eta | null> => {
|
||||
return {
|
||||
secondsRemaining,
|
||||
@@ -40,7 +40,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
shuttle: parent,
|
||||
shuttleId: parent.id,
|
||||
systemId: system.id,
|
||||
updatedTime: updatedTimeMs,
|
||||
updatedTime: updatedTime,
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -63,7 +63,7 @@ export const ShuttleResolvers: Resolvers<ServerContext> = {
|
||||
name: route.name,
|
||||
polylineCoordinates: route.polylineCoordinates,
|
||||
systemId: system.id,
|
||||
updatedTimeMs: route.updatedTimeMs
|
||||
updatedTimeMs: route.updatedTime
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -36,7 +36,7 @@ export const SystemResolvers: Resolvers<ServerContext> = {
|
||||
name: stop.name,
|
||||
coordinates: stop.coordinates as Coordinates,
|
||||
systemId: parent.id,
|
||||
updatedTimeMs: stop.updatedTimeMs,
|
||||
updatedTimeMs: stop.updatedTime,
|
||||
};
|
||||
},
|
||||
route: async (parent, args, contextValue, _info) => {
|
||||
@@ -56,7 +56,7 @@ export const SystemResolvers: Resolvers<ServerContext> = {
|
||||
name: route.name,
|
||||
polylineCoordinates: route.polylineCoordinates as Coordinates[],
|
||||
systemId: parent.id,
|
||||
updatedTimeMs: route.updatedTimeMs,
|
||||
updatedTimeMs: route.updatedTime,
|
||||
};
|
||||
},
|
||||
shuttle: async (parent, args, contextValue, _info) => {
|
||||
|
||||
Reference in New Issue
Block a user