Skip to content

Commit

Permalink
Fix FlightPlan properties which are actually optional (#142)
Browse files Browse the repository at this point in the history
* Clean up FlightPlan properties

* Fix typos

* Fix additional typos

* Fix more typos

* Fix failing tests
  • Loading branch information
kouak authored Jul 11, 2024
1 parent 7052d08 commit 88d709b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/little-grapes-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@dgac/nmb2b-client': patch
---

Fix FlightPlan mandatory properties which were actually optional
7 changes: 3 additions & 4 deletions src/Airspace/retrieveAUP.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { assert, beforeAll, describe, expect, test } from 'vitest';
import { makeAirspaceClient } from '..';
import { sub } from 'date-fns';
import b2bOptions from '../../tests/options';
import type { AUPSummary } from './types';
import { shouldUseRealB2BConnection } from '../../tests/utils';
import { describe, beforeAll, test, expect, assert } from 'vitest';
import type { AUPSummary } from './types';

describe('retrieveAUP', async () => {
const Airspace = await makeAirspaceClient(b2bOptions);
Expand All @@ -13,7 +12,7 @@ describe('retrieveAUP', async () => {
// Find some AUP id
const res = await Airspace.retrieveAUPChain({
amcIds: ['LFFAZAMC'],
chainDate: sub(new Date(), { days: 1 }),
chainDate: new Date(),
});

// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- TODO: Check if this condition is necessary ?
Expand Down
25 changes: 13 additions & 12 deletions src/Flight/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ export type FlightPlanHistoryInfo = {
addresses?: Array<string>;
detail?: string;
};

export interface Flight {
flightId: FlightIdentificationOutput;
divertedAerodromeOfDestination?: AerodromeICAOId;
Expand Down Expand Up @@ -381,7 +382,7 @@ export interface Flight {
| 'FILING_ALLOWED_BY_AO_CFMU'
| 'NOT_AUTHORISED'
| 'OPERATOR_MUST_REFILE';
initialFPLMessageOritinator?: MessageOriginator;
initialFPLMessageOriginator?: MessageOriginator;
lastFPLMessageOriginator?: MessageOriginator;
icaoRoute?: string;
routeLength?: DistanceNM;
Expand All @@ -408,7 +409,7 @@ export interface Flight {
ftfmRestrictionProfile?: FlightRestriction[];
rtfmRestrictionProfile?: FlightRestriction[];
ctfmRestrictionProfile?: FlightRestriction[];
cmfuFlightType?: CfmuFlightType;
cfmuFlightType?: CfmuFlightType;
ccamsSSRCode?: SSRCode;
filedRegistrationMark?: AircraftRegistrationMark;
isProposalFlight?: boolean;
Expand All @@ -433,7 +434,7 @@ export interface Flight {
// SlotSwapCandidate,
ifplId: IFPLId;
subjectDeltaDelayMinutes: number;
cadidateDeltaDelayMinutes: number;
candidateDeltaDelayMinutes: number;
swapDecideByTime: DateTimeMinute;
}>;
aircraftAddress?: ICAOAircraftAddress;
Expand Down Expand Up @@ -599,7 +600,7 @@ export type ArrivalInformation = {
flightStatusInbound?: ATVFlightStatusInbound;
registrationMark?: AircraftRegistrationMark;
aircraftType?: AircraftTypeICAOId;
aicraftIATAId?: AircraftIATAId;
aircraftIATAId?: AircraftIATAId;
arrivalTaxiTime?: DurationHourMinute;
apiArrivalProcedure?: TerminalProcedure;
nmArrivalProcedure?: TerminalProcedure;
Expand Down Expand Up @@ -770,20 +771,20 @@ export interface FlightPlan {
ifplId?: IFPLId;
airFiledData?: AirFiledData;
aerodromeOfDeparture?: Aerodrome;
aerodromesOfDestination: AerodromesOfDestination;
aerodromesOfDestination?: AerodromesOfDestination;
enrouteAlternateAerodromes?: AlternateAerodrome_DataType;
takeOffAlternateAerodromes?: AlternateAerodrome_DataType;
aircraftId?: AircraftIdentification;
whatIfRerouteReference?: number;
numberOfAicraft?: number;
aircraftType: AircraftType;
numberOfAircraft?: number;
aircraftType?: AircraftType;
totalEstimatedElapsedTime?: DurationHourMinute;
eetsToLocations?: EstimatedElapsedTimeAtLocation[];
wakeTubulenceCategory?: WakeTurbulenceCategory;
wakeTurbulenceCategory?: WakeTurbulenceCategory;
flightType?: FlightType;
flightRules?: FlightRules;
estimatedOffBlockTime: DateTimeMinute;
icaoRoute: string;
icaoRoute?: string;
stayInformation?: Array<string>; // Array<StayInformation_DataType>;
enrouteDelays?: Array<EnrouteDelay>;
equipmentCapabilityAndStatus?: EquipmentCapabilityAndStatus;
Expand All @@ -800,7 +801,7 @@ export type SupplementaryInformation = {
otherSurvivalEquipment?: string;
lifeJacketEquipment?: Array<LifeJacketEquipment>;
dinghiesInformation?: Dinghies;
aircraftCoulorAndMarkings?: string;
aircraftColourAndMarkings?: string;
pilotInCommand?: string;
};

Expand Down Expand Up @@ -1045,7 +1046,7 @@ export interface ExclusionFromRegulations {
onTrafficVolume?: boolean;
count?: number;
all?: boolean;
hasBeenExclused: boolean;
hasBeenExcluded: boolean;
}

export interface ReroutingReference {
Expand Down Expand Up @@ -1116,7 +1117,7 @@ export interface FlightOperationalLogEntry {
}

export type FlightOperationalLogEntryType =
| 'ENVIRONMENT_MESSSAGE'
| 'ENVIRONMENT_MESSAGE'
| 'ERRONEOUS_INCOMING_MESSAGE'
| 'ERROR_MESSAGE'
| 'HISTORY'
Expand Down
4 changes: 2 additions & 2 deletions src/Flow/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export type CountsValue = number;

export type OTMVThresholds = {
peakThreshold?: OTMVThreshold;
sustaintedThreshold?: OTMVThreshold;
sustainedThreshold?: OTMVThreshold;
sustainedElapsedDuration?: DurationHourMinute;
sustainedCrossingOccurences?: number;
};
Expand Down Expand Up @@ -376,7 +376,7 @@ export type SubTotalsRegulationDetailedType =
/**
* The count of not yet airborne zero (0) delay flights of which most penalising regulation is the target regulation or any other regulation.
*/
| 'ZERO_DELAY_FLIGHTS_NOT_YET_AIRBONE'
| 'ZERO_DELAY_FLIGHTS_NOT_YET_AIRBORNE'
/**
* The count of airborne zero (0) delay flights of which most penalising regulation is the target regulation or any other regulation.
*/
Expand Down

0 comments on commit 88d709b

Please sign in to comment.