summaryrefslogtreecommitdiff
path: root/jws/epibazaar/shop/src/main/resources/openapi.yaml
blob: 7b6928f3660c843ca0d2442a8a070270b4f54c26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
---
openapi: 3.1.0
tags:
- name: Game Management
- name: Inventory Management
- name: Shop Management
- name: Shop Operations
- name: Shop Upgrades
components:
  schemas:
    ItemRequest:
      type: object
      properties:
        quantity:
          type: number
          format: float
        type:
          $ref: "#/components/schemas/ResourceType"
    ItemResponse:
      type: object
      properties:
        id:
          type: integer
          format: int32
        quantity:
          type: number
          format: float
        type:
          $ref: "#/components/schemas/ResourceType"
    ItemsRequest:
      type: object
      properties:
        itemsRequest:
          type: array
          items:
            $ref: "#/components/schemas/ItemRequest"
    ItemsResponse:
      type: object
      properties:
        itemsResponse:
          type: array
          items:
            $ref: "#/components/schemas/ItemResponse"
    ResourceType:
      type: string
      enum:
      - MONEY
      - GROUND
      - WATER
      - ROCK
      - WOOD
    ShopPriceResponse:
      type: object
      properties:
        shopPrice:
          type: number
          format: float
    ShopResponse:
      type: object
      properties:
        id:
          type: integer
          format: int32
        priceMultiplier:
          type: number
          format: float
        upgradePrice:
          type: number
          format: float
    ShopsResponse:
      type: object
      properties:
        shops:
          type: array
          items:
            $ref: "#/components/schemas/ShopResponse"
paths:
  /:
    get:
      summary: Get all shops.
      description: Retrieves all available shops.
      x-quarkus-openapi-method-ref: m869844210_-222983088
      tags:
      - Shop Management
      responses:
        "200":
          description: The shops were successfully retrieved.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ShopsResponse"
        "400":
          description: The game is not running.
      servers:
      - url: http://localhost:8082/
    post:
      summary: Create a new shop.
      description: Creates a new shop.
      x-quarkus-openapi-method-ref: m869844210_1764851887
      tags:
      - Shop Management
      responses:
        "204":
          description: The shop creation request was successfully sent.
        "400":
          description: "The game has reached its max capacity, you do not have enough\
            \ money, or the game is not running."
        "404":
          description: No money item found.
      servers:
      - url: http://localhost:8082/
  /price:
    get:
      summary: Get the current shop price.
      description: Retrieves the current shop price.
      x-quarkus-openapi-method-ref: m869844210_-271831484
      tags:
      - Shop Management
      responses:
        "200":
          description: The shop price was successfully retrieved.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ShopPriceResponse"
        "400":
          description: The game is not running.
      servers:
      - url: http://localhost:8082/
  /resources:
    get:
      summary: Retrieve available resources in inventory.
      description: Fetch all resources currently available in the inventory.
      x-quarkus-openapi-method-ref: m911209932_-1184004262
      tags:
      - Inventory Management
      responses:
        "200":
          description: The resources were successfully retrieved.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ItemsResponse"
        "400":
          description: The game is not running or the request is invalid.
      servers:
      - url: http://localhost:8082/
  /sell/{id}:
    patch:
      summary: Sell items to a client.
      description: Processes the sale of items to a client.
      x-quarkus-openapi-method-ref: m869844210_-1356306674
      tags:
      - Shop Operations
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ItemsRequest"
        required: true
      responses:
        "204":
          description: The sell request was successfully sent.
        "400":
          description: "You do not have enough resources, an item is not sellable,\
            \ an amount is invalid, or the game is not running."
        "404":
          description: The shop or an item was not found.
      servers:
      - url: http://localhost:8082/
  /start:
    post:
      summary: Start the game.
      description: Starts the game by sending a Kafka command.
      x-quarkus-openapi-method-ref: m869844210_1873672464
      tags:
      - Game Management
      responses:
        "204":
          description: The game started successfully.
      servers:
      - url: http://localhost:8082/
  /upgrade/price/{id}:
    patch:
      summary: Upgrade the resource price for a specific shop.
      description: Increases the resource price for a specific shop.
      x-quarkus-openapi-method-ref: m869844210_-999917025
      tags:
      - Shop Upgrades
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "204":
          description: The price upgrade request was successfully sent.
        "400":
          description: You do not have enough money or the game is not running.
        "404":
          description: The shop was not found or the money was not found.
      servers:
      - url: http://localhost:8082/
  /{id}:
    get:
      summary: Get a specific shop.
      description: Retrieves details of a specific shop.
      x-quarkus-openapi-method-ref: m869844210_868322035
      tags:
      - Shop Management
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: The shop was successfully retrieved.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ShopResponse"
        "400":
          description: The game is not running or the ID is not valid.
        "404":
          description: The shop was not found.
      servers:
      - url: http://localhost:8082/
info:
  title: shop API
  version: 1.0.0