character rule book store

This commit is contained in:
Sirttas
2026-06-11 19:42:56 +02:00
parent 9cd0d5fb5e
commit f3cb4798d5
5 changed files with 540 additions and 55 deletions
+218 -21
View File
@@ -57,7 +57,10 @@ paths:
schema:
$ref: "#/components/schemas/RuleBookResponse"
"400":
description: Invalid request (e.g. blank name)
description: |-
Returned when:
- the request is invalid (e.g. blank name)
- the rule book is the default rule book, which cannot be modified
delete:
tags:
- rule-book
@@ -75,7 +78,10 @@ paths:
"204":
description: The rule book was deleted
"400":
description: The rule book is associated to a character
description: |-
Returned when:
- the rule book is associated to a character
- the rule book is the default rule book, which cannot be deleted
/ledgers/main/{ledgerId}:
put:
tags:
@@ -105,7 +111,10 @@ paths:
schema:
$ref: "#/components/schemas/MainLedgerResponse"
"400":
description: "The ledger is not a main ledger, or the request is invalid"
description: |-
Returned when:
- the ledger is not a main ledger
- the request is invalid
"404":
description: No ledger with this id
/ledgers/combined/{ledgerId}:
@@ -137,7 +146,10 @@ paths:
schema:
$ref: "#/components/schemas/CombinedLedgerResponse"
"400":
description: "The ledger is not a combined ledger, or the request is invalid"
description: |-
Returned when:
- the ledger is not a combined ledger
- the request is invalid
"404":
description: No ledger with this id
/characters/{characterId}/rule-book:
@@ -193,8 +205,12 @@ paths:
schema:
$ref: "#/components/schemas/CharacterRuleBookResponse"
"400":
description: "The referenced rule book or a bound ledger does not exist,\
\ or a ledger binding is missing"
description: |-
Returned when:
- the referenced rule book does not exist
- a bound ledger does not exist
- a bound ledger is not a main or system ledger
- a required ledger binding is missing
/rule-books:
get:
tags:
@@ -225,6 +241,13 @@ paths:
responses:
"201":
description: The created rule book
headers:
Location:
description: URL of the created rule book
style: simple
schema:
type: string
format: uri
content:
'*/*':
schema:
@@ -256,6 +279,13 @@ paths:
responses:
"201":
description: The created main ledger
headers:
Location:
description: URL of the created main ledger
style: simple
schema:
type: string
format: uri
content:
'*/*':
schema:
@@ -278,6 +308,13 @@ paths:
responses:
"201":
description: The created combined ledger
headers:
Location:
description: URL of the created combined ledger
style: simple
schema:
type: string
format: uri
content:
'*/*':
schema:
@@ -326,6 +363,86 @@ paths:
text/plain:
schema:
type: string
/market/{marketTypeId}/history:
get:
tags:
- market
summary: "Find the market history of a type, most recent first"
operationId: findHistory
parameters:
- name: marketTypeId
in: path
description: Id of the market type
required: true
schema:
type: integer
format: int64
- name: days
in: query
description: Optional number of most recent days to return; omit for the full
history
required: false
schema:
type: string
minimum: 1
responses:
"200":
description: The market history of the type
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/MarketHistoryResponse"
"400":
description: The days parameter is not greater than 0
/market/scan:
get:
tags:
- market
summary: "Scan every tracked market type, returning volume-weighted price quartiles\
\ for each"
operationId: scanMarket
parameters:
- name: days
in: query
description: Number of most recent days of history to analyse
required: false
schema:
type: string
default: "365"
minimum: 1
- name: brokerFee
in: query
description: "Broker fee as a fraction (e.g. 0.015 for 1.5%), paid on both\
\ buy and sell orders"
required: false
schema:
type: string
default: "0.015"
maximum: 1
minimum: 0
- name: salesTax
in: query
description: "Sales tax as a fraction (e.g. 0.036 for 3.6%), paid on sell\
\ orders"
required: false
schema:
type: string
default: "0.036"
maximum: 1
minimum: 0
responses:
"200":
description: "The scan results, one entry per tracked market type"
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/MarketScanResponse"
"400":
description: The days parameter is not greater than 0
/ledgers:
get:
tags:
@@ -429,6 +546,21 @@ paths:
type: array
items:
$ref: "#/components/schemas/CharacterResponse"
/characters/rule-books:
get:
tags:
- character-rule-book
summary: Find the rule books of all characters that have a token
operationId: findAllCharacterRuleBooks
responses:
"200":
description: Rule book assignments of all characters with a token
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/CharacterRuleBookResponse"
/acquisitions:
get:
tags:
@@ -560,15 +692,24 @@ components:
required:
- bindings
- ruleBookId
CharacterRuleBookResponse:
CharacterResponse:
type: object
properties:
characterId:
type: integer
format: int64
ruleBookId:
name:
type: string
format: uuid
required:
- characterId
- name
CharacterRuleBookResponse:
type: object
properties:
character:
$ref: "#/components/schemas/CharacterResponse"
ruleBook:
$ref: "#/components/schemas/RuleBookSummaryResponse"
bindings:
type: object
additionalProperties:
@@ -576,7 +717,18 @@ components:
format: uuid
required:
- bindings
- characterId
- character
- ruleBook
RuleBookSummaryResponse:
type: object
properties:
ruleBookId:
type: string
format: uuid
name:
type: string
required:
- name
- ruleBookId
CreateRuleBookRequest:
type: object
@@ -617,6 +769,62 @@ components:
required:
- memberLedgerIds
- name
MarketHistoryResponse:
type: object
properties:
marketTypeId:
type: integer
format: int64
date:
type: string
format: date
average:
type: number
highest:
type: number
lowest:
type: number
orderCount:
type: integer
format: int64
volume:
type: integer
format: int64
required:
- average
- date
- highest
- lowest
- marketTypeId
- orderCount
- volume
MarketScanResponse:
type: object
properties:
marketTypeId:
type: integer
format: int64
q1:
type: number
median:
type: number
q3:
type: number
totalVolume:
type: integer
format: int64
profit:
type: number
score:
type: number
required:
- marketTypeId
- median
- profit
- q1
- q3
- score
- totalVolume
LedgerResponse:
discriminator:
propertyName: type
@@ -732,17 +940,6 @@ components:
required:
- quantity
- typeId
CharacterResponse:
type: object
properties:
characterId:
type: integer
format: int64
name:
type: string
required:
- characterId
- name
AcquisitionResponse:
type: object
properties: