Extend IFlightLeg with optional daysOfWeek field

This commit is contained in:
2026-04-17 02:00:33 +03:00
parent 888d19f8f3
commit 859886def8
2 changed files with 28 additions and 0 deletions
+14
View File
@@ -21,6 +21,7 @@ import type {
IOnBoardService,
IAircraftInfo,
IEquipmentFull,
IDaysOfWeek,
} from "./types.js";
/**
@@ -287,4 +288,17 @@ describe("online-board types extension", () => {
expect(leg.transition?.registration?.status).toBe("Finished");
expect(leg.equipment?.aircraft?.actual?.title).toBe("A320");
});
it("IDaysOfWeek has current and flight bit strings", () => {
const d: IDaysOfWeek = { current: "1000010", flight: "1111111" };
expect(d.current).toBe("1000010");
expect(d.flight).toBe("1111111");
});
it("IFlightLeg accepts optional daysOfWeek", () => {
const leg: Partial<IFlightLeg> = {
daysOfWeek: { current: "1000010", flight: "1111111" },
};
expect(leg.daysOfWeek?.flight).toBe("1111111");
});
});
+14
View File
@@ -100,6 +100,19 @@ export interface IFlightLegFlags {
routeChanged: boolean;
}
// ---------------------------------------------------------------------------
// Days of week
// ---------------------------------------------------------------------------
/**
* Bit-string indicator of flight operation days.
* Position 0 = Monday, position 6 = Sunday. `"1"` means active.
*/
export interface IDaysOfWeek {
current: string;
flight: string;
}
// ---------------------------------------------------------------------------
// Transition (registration/boarding/deboarding)
// ---------------------------------------------------------------------------
@@ -166,6 +179,7 @@ export interface IFlightLeg {
status: FlightStatus;
updated: string;
transition?: IFlightTransitions;
daysOfWeek?: IDaysOfWeek;
}
// ---------------------------------------------------------------------------