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,25 @@
import { describe, expect, it } from "vitest";
import { compareSchedulingPriority } from "./compareSchedulingPriority";
describe("compareSchedulingPriority", () => {
it("ranks government above commercial regardless of date gap", () => {
const gov = {
isGovernment: true,
priorityScore: 100,
scheduledDate: "2026-06-25T08:00:00.000Z",
};
const commercial = {
isGovernment: false,
priorityScore: 50000,
scheduledDate: "2026-06-20T08:00:00.000Z",
};
expect(compareSchedulingPriority(gov, commercial)).toBeLessThan(0);
});
it("sorts by priority score within same tier", () => {
const high = { priorityScore: 100, scheduledDate: "2026-06-20T08:00:00.000Z" };
const low = { priorityScore: 10, scheduledDate: "2026-06-20T08:00:00.000Z" };
expect(compareSchedulingPriority(high, low)).toBeLessThan(0);
});
});