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": { "transactions": {
"type": "array", "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": { "items": {
"$ref": "./MarketTransaction.json" "$ref": "./MarketTransaction.json"
} }
}, },
"tradeGoods": { "tradeGoods": {
"type": "array", "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": { "items": {
"$ref": "./MarketTradeGood.json" "$ref": "./MarketTradeGood.json"
} }
@ -50,8 +50,6 @@
"required": [ "required": [
"symbol", "symbol",
"exports", "exports",
"imports", "imports"
"transactions",
"tradeGoods"
] ]
} }

View File

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

View File

@ -68,9 +68,19 @@
"schema": { "schema": {
"properties": { "properties": {
"faction": { "faction": {
"default": "COMMERCE_REPUBLIC",
"description": "The faction you choose determines your headquarters.", "description": "The faction you choose determines your headquarters.",
"type": "string" "enum": [
"COSMIC",
"VOID",
"GALLACTIC",
"QUANTUM",
"DOMINION",
"ASTRO",
"CORSAIRS",
"UNITED",
"SOLITARY",
"COBALT"
]
}, },
"symbol": { "symbol": {
"description": "How other agents will see your ships and information.", "description": "How other agents will see your ships and information.",
@ -1984,6 +1994,87 @@
"fleet" "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"
]
}
} }
} }
} }