Rename getArrivedStopIfExists to getArrivedStopIfNextStop, and add more documentation
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { ShuttleGetterSetterRepository } from "./ShuttleGetterSetterRepository";
|
||||
import { IEta, IOrderedStop, IRoute, IShuttle, IStop, shuttleHasArrivedAtStop } from "../../entities/ShuttleRepositoryEntities";
|
||||
import {
|
||||
ShuttleRepositoryEvent,
|
||||
ShuttleRepositoryEventListener,
|
||||
ShuttleRepositoryEventName,
|
||||
ShuttleRepositoryEventPayloads,
|
||||
ShuttleStopArrival,
|
||||
ShuttleTravelTimeDataIdentifier,
|
||||
ShuttleTravelTimeDateFilterArguments
|
||||
ShuttleRepositoryEvent,
|
||||
ShuttleRepositoryEventListener,
|
||||
ShuttleRepositoryEventName,
|
||||
ShuttleRepositoryEventPayloads,
|
||||
ShuttleStopArrival,
|
||||
ShuttleTravelTimeDataIdentifier,
|
||||
ShuttleTravelTimeDateFilterArguments
|
||||
} from "./ShuttleGetterRepository";
|
||||
import { BaseRedisRepository } from "../BaseRedisRepository";
|
||||
import { RedisClientType } from "redis";
|
||||
@@ -375,9 +375,9 @@ export class RedisShuttleRepository extends BaseRedisRepository implements Shutt
|
||||
if (isAtStop) {
|
||||
// Allow retrieval of the shuttle's current stop
|
||||
// Will still return undefined when the shuttle leaves the stop
|
||||
arrivedStop = await this.getArrivedStopIfExists(shuttle, true);
|
||||
arrivedStop = await this.getArrivedStopIfNextStop(shuttle, true);
|
||||
} else {
|
||||
arrivedStop = await this.getArrivedStopIfExists(shuttle, false);
|
||||
arrivedStop = await this.getArrivedStopIfNextStop(shuttle, false);
|
||||
}
|
||||
|
||||
// Will not fire *any* events if the same stop
|
||||
@@ -452,7 +452,7 @@ export class RedisShuttleRepository extends BaseRedisRepository implements Shutt
|
||||
}
|
||||
}
|
||||
|
||||
public async getArrivedStopIfExists(
|
||||
public async getArrivedStopIfNextStop(
|
||||
shuttle: IShuttle,
|
||||
canReturnShuttleCurrentStop: boolean = false,
|
||||
): Promise<IStop | undefined> {
|
||||
|
||||
Reference in New Issue
Block a user