Skip to content

Commit

Permalink
Merge pull request #88 from opensky-to/agent#79-new-fuel-truck
Browse files Browse the repository at this point in the history
Agent#79 new fuel truck
  • Loading branch information
sushiat authored Nov 28, 2023
2 parents ee97684 + 4ae2754 commit 750b38a
Show file tree
Hide file tree
Showing 10 changed files with 633 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
if (value is ICollection collection)
{
if (parameter is "invert")
{
return collection.Count > 0 ? Visibility.Collapsed : Visibility.Visible;
}

return collection.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
}

Expand Down
317 changes: 311 additions & 6 deletions OpenSky.Client/OpenAPIs/swagger.cs

Large diffs are not rendered by default.

214 changes: 210 additions & 4 deletions OpenSky.Client/OpenAPIs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,58 @@
}
}
},
"/Aircraft/reregister": {
"put": {
"tags": [
"Aircraft"
],
"summary": "Re-register aircraft.",
"description": "sushi.at, 28/11/2023.",
"operationId": "ReRegisterAircraft",
"requestBody": {
"description": "The re-register data.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ReRegisterAircraft"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ReRegisterAircraft"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/ReRegisterAircraft"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/StringApiResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/StringApiResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/StringApiResponse"
}
}
}
}
}
}
},
"/Aircraft/searchAroundAirport": {
"post": {
"tags": [
Expand Down Expand Up @@ -822,6 +874,17 @@
"summary": "Adds a new aircraft type.",
"description": "sushi.at, 02/06/2021.",
"operationId": "AddAircraftType",
"parameters": [
{
"name": "upgradeForType",
"in": "query",
"description": "The ID of the aircraft type this one is an update for (auto adjusts next version and variants).",
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"description": "The new aircraft type to add.",
"content": {
Expand All @@ -848,17 +911,17 @@
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/StringApiResponse"
"$ref": "#/components/schemas/GuidApiResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/StringApiResponse"
"$ref": "#/components/schemas/GuidApiResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/StringApiResponse"
"$ref": "#/components/schemas/GuidApiResponse"
}
}
}
Expand Down Expand Up @@ -3441,6 +3504,60 @@
}
}
},
"/Flight/lastMinuteFuel/{flightID}/{gallons}": {
"post": {
"tags": [
"Flight"
],
"summary": "Purchase last minute fuel before departure at increased prices.",
"description": "sushi.at, 28/11/2023.",
"operationId": "PurchaseLastMinuteFuel",
"parameters": [
{
"name": "flightID",
"in": "path",
"description": "Identifier for the flight.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "gallons",
"in": "path",
"description": "The gallons to purchase.",
"required": true,
"schema": {
"type": "number",
"format": "double"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/DoubleApiResponse"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/DoubleApiResponse"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/DoubleApiResponse"
}
}
}
}
}
}
},
"/Flight/start": {
"post": {
"tags": [
Expand Down Expand Up @@ -4895,6 +5012,7 @@
13,
14,
15,
16,
20,
21,
22,
Expand All @@ -4915,7 +5033,7 @@
92
],
"type": "integer",
"description": "Airline roles. 10 = BuyAircraft, 11 = SellAircraft, 12 = RentAircraft, 13 = RentOutAircraft, 14 = AssignAircraft, 15 = RenameAircraft, 20 = BuyFBO, 21 = SellFBO, 22 = RentFBO, 23 = RentOutFBO, 24 = RenameFBO, 25 = OrderFuel, 30 = AcceptJobs, 31 = Dispatch, 32 = OutsourceJobs, 33 = AbortJobs, 40 = ModifyAircraft, 41 = MaintainAircraft, 42 = ReplaceAircraftParts, 43 = PerformGroundOperations, 50 = FinancialRecords, 90 = ChangePermissions, 91 = BoardMember, 92 = AllPermissions",
"description": "Airline roles. 10 = BuyAircraft, 11 = SellAircraft, 12 = RentAircraft, 13 = RentOutAircraft, 14 = AssignAircraft, 15 = RenameAircraft, 16 = ReRegisterAircraft, 20 = BuyFBO, 21 = SellFBO, 22 = RentFBO, 23 = RentOutFBO, 24 = RenameFBO, 25 = OrderFuel, 30 = AcceptJobs, 31 = Dispatch, 32 = OutsourceJobs, 33 = AbortJobs, 40 = ModifyAircraft, 41 = MaintainAircraft, 42 = ReplaceAircraftParts, 43 = PerformGroundOperations, 50 = FinancialRecords, 90 = ChangePermissions, 91 = BoardMember, 92 = AllPermissions",
"format": "int32",
"x-enumNames": [
"BuyAircraft",
Expand All @@ -4924,6 +5042,7 @@
"RentOutAircraft",
"AssignAircraft",
"RenameAircraft",
"ReRegisterAircraft",
"BuyFBO",
"SellFBO",
"RentFBO",
Expand All @@ -4950,6 +5069,7 @@
"RentOutAircraft",
"AssignAircraft",
"RenameAircraft",
"ReRegisterAircraft",
"BuyFBO",
"SellFBO",
"RentFBO",
Expand Down Expand Up @@ -6384,6 +6504,37 @@
"additionalProperties": false,
"description": "API standard response model."
},
"DoubleApiResponse": {
"type": "object",
"properties": {
"data": {
"type": "number",
"description": "Gets or sets the embedded data of type T.",
"format": "double"
},
"errorDetails": {
"type": "string",
"description": "Gets or sets the error details (NULL if no error).",
"nullable": true
},
"isError": {
"type": "boolean",
"description": "Gets or sets a value indicating whether this response is reporting an error."
},
"message": {
"type": "string",
"description": "Gets or sets the message.",
"nullable": true
},
"status": {
"type": "string",
"description": "Gets or sets the status.",
"nullable": true
}
},
"additionalProperties": false,
"description": "API standard response model."
},
"EngineType": {
"enum": [
0,
Expand Down Expand Up @@ -7492,6 +7643,10 @@
"GroundOperations": {
"type": "object",
"properties": {
"allowFuelTrucking": {
"type": "boolean",
"description": "Gets or sets a value indicating whether we allow fuel trucking."
},
"fuel": {
"type": "number",
"description": "Gets or sets the target fuel in gallons.",
Expand All @@ -7515,6 +7670,37 @@
"additionalProperties": false,
"description": "Ground operations model."
},
"GuidApiResponse": {
"type": "object",
"properties": {
"data": {
"type": "string",
"description": "Gets or sets the embedded data of type T.",
"format": "uuid"
},
"errorDetails": {
"type": "string",
"description": "Gets or sets the error details (NULL if no error).",
"nullable": true
},
"isError": {
"type": "boolean",
"description": "Gets or sets a value indicating whether this response is reporting an error."
},
"message": {
"type": "string",
"description": "Gets or sets the message.",
"nullable": true
},
"status": {
"type": "string",
"description": "Gets or sets the status.",
"nullable": true
}
},
"additionalProperties": false,
"description": "API standard response model."
},
"GuidNullableApiResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -8247,6 +8433,26 @@
"additionalProperties": false,
"description": "Purchase new aircraft model."
},
"ReRegisterAircraft": {
"type": "object",
"properties": {
"from": {
"type": "string",
"description": "Gets or sets the old registry.",
"nullable": true
},
"inCountry": {
"$ref": "#/components/schemas/Country"
},
"to": {
"type": "string",
"description": "Gets or sets the new registry.",
"nullable": true
}
},
"additionalProperties": false,
"description": "Re-register aircraft model."
},
"RefreshToken": {
"type": "object",
"properties": {
Expand Down
18 changes: 9 additions & 9 deletions OpenSky.Client/OpenSky.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@
<Version>2023.3.0</Version>
</PackageReference>
<PackageReference Include="MdXaml">
<Version>1.21.0</Version>
<Version>1.22.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers">
<Version>7.0.4</Version>
Expand Down Expand Up @@ -616,31 +616,31 @@
<Version>0.2.0</Version>
</PackageReference>
<PackageReference Include="Syncfusion.SfChart.WPF">
<Version>23.1.44</Version>
<Version>23.2.6</Version>
</PackageReference>
<PackageReference Include="Syncfusion.SfInput.WPF">
<Version>23.1.44</Version>
<Version>23.2.6</Version>
</PackageReference>
<PackageReference Include="Syncfusion.SfProgressBar.WPF">
<Version>23.1.44</Version>
<Version>23.2.6</Version>
</PackageReference>
<PackageReference Include="Syncfusion.SfSkinManager.Wpf">
<Version>23.1.44</Version>
<Version>23.2.6</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Shared.WPF">
<Version>23.1.44</Version>
<Version>23.2.6</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Themes.MaterialDark.WPF">
<Version>23.1.44</Version>
<Version>23.2.6</Version>
</PackageReference>
<PackageReference Include="Syncfusion.Tools.WPF">
<Version>23.1.44</Version>
<Version>23.2.6</Version>
</PackageReference>
<PackageReference Include="System.Data.SQLite">
<Version>1.0.118</Version>
</PackageReference>
<PackageReference Include="System.Linq.Dynamic.Core">
<Version>1.3.5</Version>
<Version>1.3.7</Version>
</PackageReference>
<PackageReference Include="TomsToolbox.Wpf">
<Version>2.10.0</Version>
Expand Down
8 changes: 4 additions & 4 deletions OpenSky.Client/Pages/Models/FlightPlanViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,8 +1142,8 @@ private void StartFlight()
{
var messageBox = new OpenSkyMessageBox(
"No AV gas",
"The origin airport does not sell AV gas, do you want to start the flight with the fuel already on board the aircraft?"
+ "\r\n\r\nWARNING: You may not enough fuel to reach your destination!",
"The origin airport does not sell AV gas, do you want to truck the fuel in from outside the airport?"
+ "\r\n\r\nWARNING: You will be charged at greatly increased rates and it will take 30 minutes for the truck to arrive!",
MessageBoxButton.YesNo,
ExtendedMessageBoxImage.Question);
messageBox.Closed += (_, _) => { answer = messageBox.Result; };
Expand Down Expand Up @@ -1175,8 +1175,8 @@ private void StartFlight()
{
var messageBox = new OpenSkyMessageBox(
"No jet fuel",
"The origin airport does not sell jet fuel, do you want to start the flight with the fuel already on board the aircraft?"
+ "\r\n\r\nWARNING: You may not enough fuel to reach your destination!",
"The origin airport does not sell jet fuel, do you want to truck the fuel in from outside the airport?"
+ "\r\n\r\nWARNING: You will be charged at greatly increased rates and it will take 30 minutes for the truck to arrive!",
MessageBoxButton.YesNo,
ExtendedMessageBoxImage.Question);
messageBox.Closed += (_, _) => { answer = messageBox.Result; };
Expand Down
Loading

0 comments on commit 750b38a

Please sign in to comment.