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