add transfer endpoint, tweaks to market

This commit is contained in:
Space Admiral 2022-12-16 19:03:59 -08:00
parent 8d508283cd
commit 754b578438
3 changed files with 97 additions and 8 deletions

View File

@ -34,14 +34,14 @@
},
"transactions": {
"type": "array",
"description": "The list of recent transactions at this market.",
"description": "The list of recent transactions at this market. Visible only when a ship is present at the market.",
"items": {
"$ref": "./MarketTransaction.json"
}
},
"tradeGoods": {
"type": "array",
"description": "The list of goods that are traded at this market.",
"description": "The list of goods that are traded at this market. Visible only when a ship is present at the market.",
"items": {
"$ref": "./MarketTradeGood.json"
}
@ -50,8 +50,6 @@
"required": [
"symbol",
"exports",
"imports",
"transactions",
"tradeGoods"
"imports"
]
}

View File

@ -26,7 +26,7 @@
}
},
"faction": {
"$ref": "./Faction.json"
"$ref": "./WaypointFaction.json"
},
"traits": {
"type": "array",

View File

@ -68,9 +68,19 @@
"schema": {
"properties": {
"faction": {
"default": "COMMERCE_REPUBLIC",
"description": "The faction you choose determines your headquarters.",
"type": "string"
"enum": [
"COSMIC",
"VOID",
"GALLACTIC",
"QUANTUM",
"DOMINION",
"ASTRO",
"CORSAIRS",
"UNITED",
"SOLITARY",
"COBALT"
]
},
"symbol": {
"description": "How other agents will see your ships and information.",
@ -1984,6 +1994,87 @@
"fleet"
]
}
},
"/my/ships/{shipSymbol}/transfer": {
"parameters": [
{
"in": "path",
"name": "shipSymbol",
"required": true,
"schema": {
"type": "string"
}
}
],
"post": {
"description": "Transfer cargo between ships.",
"operationId": "transfer-cargo",
"requestBody": {
"content": {
"application/json": {
"schema": {
"title": "Transfer Cargo Request",
"properties": {
"tradeSymbol": {
"type": "string"
},
"units": {
"type": "integer"
},
"shipSymbol": {
"type": "string"
}
},
"required": [
"tradeSymbol",
"units",
"shipSymbol"
],
"type": "object"
}
}
}
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"title": "Transfer Cargo 200 Response",
"description": "",
"properties": {
"data": {
"properties": {
"cargo": {
"$ref": "../models/ShipCargo.json"
}
},
"required": [
"cargo"
],
"type": "object"
}
},
"required": [
"data"
],
"type": "object"
}
}
},
"description": "Created"
}
},
"security": [
{
"AgentToken": []
}
],
"summary": "Transfer Cargo",
"tags": [
"fleet"
]
}
}
}
}