booking operations and trains scheduling also allocations

This commit is contained in:
marshal
2026-06-10 00:48:32 +03:00
parent 675975bc08
commit 5774d7db9d
180 changed files with 13423 additions and 3877 deletions

View File

@@ -0,0 +1,23 @@
import type { BookingListRow } from "@/types/booking";
import { compareSchedulingPriority } from "./compareSchedulingPriority";
import {
groupBookingsByThreeHourWindow,
type ThreeHourBookingBucket,
} from "./groupBookingsByThreeHourWindow";
export interface OperationsQueueGroups {
government: BookingListRow[];
commercial: ThreeHourBookingBucket[];
}
export function groupBookingsForOperationsQueue(
bookings: BookingListRow[],
): OperationsQueueGroups {
const government = bookings
.filter((b) => b.isGovernment)
.sort(compareSchedulingPriority);
const commercial = groupBookingsByThreeHourWindow(
bookings.filter((b) => !b.isGovernment),
);
return { government, commercial };
}