Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docker/mock/simbrief/xml.fetcher-111222-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
]
},
"aircraft": {
"reg": "D-AIMC"
"reg": "D-AIMC",
"icaocode": "A339"
},
"times": {
"sched_out": "1767603600",
Expand Down
3 changes: 2 additions & 1 deletion docker/mock/simbrief/xml.fetcher-123456-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@
]
},
"aircraft": {
"reg": "D-AIMC"
"reg": "D-AIMC",
"icaocode": "A339"
},
"times": {
"sched_out": "1767603600",
Expand Down
3 changes: 2 additions & 1 deletion docker/mock/simbrief/xml.fetcher-333444-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
]
},
"aircraft": {
"reg": "D-AIMC"
"reg": "D-AIMC",
"icaocode": "A339"
},
"times": {
"sched_out": "1767603600",
Expand Down
18 changes: 16 additions & 2 deletions docker/mock/simbrief/xml.fetcher-654321-2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"params": {
"request_id": "162595444",
"sequence_id": "816599746ea6",
"units": "kgs"
},
"general": {
"icao_airline": "DLH",
"flight_number": "80"
"flight_number": "80",
"is_etops": "1",
"gc_distance": "3350",
"total_burn": "156000",
"cont_rule": "3%"
},
"origin": {
"icao_code": "EDDF",
Expand Down Expand Up @@ -77,7 +86,8 @@
]
},
"aircraft": {
"reg": "D-TEST"
"reg": "D-TEST",
"icaocode": "A339"
},
"times": {
"sched_out": "1767603600",
Expand All @@ -91,6 +101,10 @@
"est_zfw": "206523",
"pax_count": "348"
},
"text": {
"tlr_section": "TAKEOFF AND LANDING REPORT DLH80",
"plan_html": "<div><h2>Simbrief OFP</h2><p>Mock OFP</p></div>"
},
"crew": {
"pilot_id": "371340",
"cpt": "..... .....",
Expand Down
4 changes: 4 additions & 0 deletions features/aircraft/aircraft.create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Feature: Create aircraft for operator
"livery": "Sunshine",
"currentState": "idle",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -147,6 +148,7 @@ Feature: Create aircraft for operator
"livery": "Sunshine",
"currentState": "idle",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -214,6 +216,7 @@ Feature: Create aircraft for operator
"livery": "Sunshine",
"currentState": "idle",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -281,6 +284,7 @@ Feature: Create aircraft for operator
"livery": "@defaultLivery('Lufthansa')",
"currentState": "idle",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down
4 changes: 4 additions & 0 deletions features/aircraft/aircraft.get.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Feature: Get aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -68,6 +69,7 @@ Feature: Get aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -113,6 +115,7 @@ Feature: Get aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -158,6 +161,7 @@ Feature: Get aircraft
"selcal": null,
"currentState": "idle",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "5c88ea21-f482-47ff-8b1f-3d0c9bbd6caf",
Expand Down
8 changes: 8 additions & 0 deletions features/aircraft/aircraft.list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Feature: List aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -61,6 +62,7 @@ Feature: List aircraft
"selcal": "BD-EF",
"currentState": "idle",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "lh-74h",
"airlineIata": "LH",
Expand Down Expand Up @@ -123,6 +125,7 @@ Feature: List aircraft
"selcal": "BD-EG",
"currentState": "planned",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -177,6 +180,7 @@ Feature: List aircraft
"selcal": "BD-FG",
"currentState": "idle",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "lh-74h",
"airlineIata": "LH",
Expand Down Expand Up @@ -235,6 +239,7 @@ Feature: List aircraft
"selcal": "BE-FG",
"currentState": "cruise",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "lh-74h",
"airlineIata": "LH",
Expand Down Expand Up @@ -293,6 +298,7 @@ Feature: List aircraft
"selcal": "CD-EF",
"currentState": "cruise",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "lh-74h",
"airlineIata": "LH",
Expand Down Expand Up @@ -351,6 +357,7 @@ Feature: List aircraft
"selcal": "CD-EG",
"currentState": "planned",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "lh-74h",
"airlineIata": "LH",
Expand Down Expand Up @@ -409,6 +416,7 @@ Feature: List aircraft
"selcal": "CE-FG",
"currentState": "cruise",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "lh-74h",
"airlineIata": "LH",
Expand Down
69 changes: 69 additions & 0 deletions features/aircraft/aircraft.update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Feature: Update aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -121,6 +122,7 @@ Feature: Update aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -172,6 +174,7 @@ Feature: Update aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": 120,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -223,6 +226,7 @@ Feature: Update aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -274,6 +278,7 @@ Feature: Update aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "3c721cc6-c653-4fad-be43-dc9d6a149383",
Expand Down Expand Up @@ -325,6 +330,7 @@ Feature: Update aircraft
"selcal": "LR-CK",
"currentState": "planned",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": null,
"lastAirport": null,
Expand Down Expand Up @@ -543,6 +549,69 @@ Feature: Update aircraft
}
"""

Scenario: As operations I can confirm an aircraft created from an imported flight plan
Given I am signed in as "operations with Simbrief ID but non existing aircraft"
When I send a "POST" request to "/api/v1/flight/create-with-simbrief"
Then the response status should be 201
And I remember the response body property "aircraft.id" as "aircraftId"
When I send a "PATCH" request to "/api/v1/operator/40b1b34e-aea1-4cec-acbe-f2bf97c06d7d/aircraft/{{aircraftId}}" with body:
"""json
{
"isConfirmed": true
}
"""
Then the response status should be 200
And the response body should contain:
"""json
{
"id": "@uuid",
"airframe": {
"type": "A339",
"iataType": "339",
"name": "Airbus A330-900",
"cruiseSpeed": { "value": 0.8, "unit": "mach" },
"serviceCeiling": 41400,
"performanceCode": "D",
"weightCategory": "heavy",
"serviceType": "passenger"
},
"registration": "D-TEST",
"selcal": null,
"livery": "@defaultLivery('Lufthansa')",
"currentState": "planned",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"holdVariant": null,
"baseAirport": null,
"lastAirport": null,
"lastAirportUpdatedAt": null,
"lastParkingPosition": null
}
"""
And I set database to initial state

Scenario: As operations I cannot set the aircraft confirmation to null
Given I am signed in as "operations"
When I send a "PATCH" request to "/api/v1/operator/40b1b34e-aea1-4cec-acbe-f2bf97c06d7d/aircraft/9f5da1a4-f09e-4961-8299-82d688337d1f" with body:
"""json
{
"isConfirmed": null
}
"""
Then the response status should be 400
And the response body should contain:
"""json
{
"statusCode": 400,
"message": "Request validation failed.",
"error": "Bad Request",
"violations": {
"isConfirmed": ["isConfirmed must be a boolean value"]
}
}
"""

Scenario: As an unauthorized user I cannot update aircraft
When I send a "PATCH" request to "/api/v1/operator/40b1b34e-aea1-4cec-acbe-f2bf97c06d7d/aircraft/9f5da1a4-f09e-4961-8299-82d688337d1f" with body:
"""json
Expand Down
6 changes: 6 additions & 0 deletions features/aircraft/cabin-layout.assign.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Feature: Assign a cabin layout to an aircraft
"livery": "Oneworld (2023)",
"currentState": "idle",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "aa-77w",
"airlineIata": "AA",
Expand Down Expand Up @@ -100,6 +101,7 @@ Feature: Assign a cabin layout to an aircraft
"livery": "Team USA (2023)",
"currentState": "cruise",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": {
"id": "aa-77w-2",
"airlineIata": "AA",
Expand Down Expand Up @@ -169,6 +171,7 @@ Feature: Assign a cabin layout to an aircraft
"livery": "KLM (2022)",
"currentState": "planned",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"baseAirport": {
"id": "f35c094a-bec5-4803-be32-bd80a14b441a",
Expand Down Expand Up @@ -220,6 +223,7 @@ Feature: Assign a cabin layout to an aircraft
"livery": "Air France (2021)",
"currentState": "planned",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "aa-77w",
"airlineIata": "AA",
Expand Down Expand Up @@ -310,6 +314,7 @@ Feature: Assign a cabin layout to an aircraft
"livery": "Icelandair (2023)",
"currentState": "planned",
"etopsThresholdMinutes": 180,
"isConfirmed": true,
"cabinLayout": {
"id": "fi-752-1",
"airlineIata": "FI",
Expand Down Expand Up @@ -365,6 +370,7 @@ Feature: Assign a cabin layout to an aircraft
"livery": "KLM (2022)",
"currentState": "planned",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "kl-738",
"airlineIata": "KL",
Expand Down
3 changes: 3 additions & 0 deletions features/aircraft/hold-variant.assign.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Feature: Assign a cargo hold variant to an aircraft
"livery": "Sunshine (2024)",
"currentState": "checked_in",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "de-321",
"airlineIata": "DE",
Expand Down Expand Up @@ -95,6 +96,7 @@ Feature: Assign a cargo hold variant to an aircraft
"livery": "Air France (2021)",
"currentState": "planned",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"holdVariant": null,
"baseAirport": {
Expand Down Expand Up @@ -146,6 +148,7 @@ Feature: Assign a cargo hold variant to an aircraft
"livery": "Air France (2021)",
"currentState": "planned",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": null,
"holdVariant": "a320-bulk",
"baseAirport": {
Expand Down
1 change: 1 addition & 0 deletions features/aircraft/reposition/reposition.create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Feature: Reposition an aircraft
"selcal": "SK-PK",
"currentState": "checked_in",
"etopsThresholdMinutes": null,
"isConfirmed": true,
"cabinLayout": {
"id": "de-321",
"airlineIata": "DE",
Expand Down
Loading
Loading