Extend IFlightLeg with optional daysOfWeek field
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user