mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 04:08:11 +00:00
schedule logic
This commit is contained in:
@@ -16,3 +16,16 @@ export function wagonReadinessMatchesSchedule(
|
||||
if (!required) return true;
|
||||
return wagonReadiness === required;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle a readiness value (IMPORT_READY ↔ EXPORT_READY). Used when a train
|
||||
* reaches its destination: the asset has repositioned, so it is now ready for
|
||||
* the opposite direction. Direction-agnostic so it handles round trips.
|
||||
*/
|
||||
export function flipReadiness(
|
||||
readiness: WagonReadiness | string,
|
||||
): WagonReadiness {
|
||||
return readiness === WagonReadiness.ImportReady
|
||||
? WagonReadiness.ExportReady
|
||||
: WagonReadiness.ImportReady;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user