Orders Service (Changelog)
Service that handles orders
Service
-
2024-08-01 (latest)
This is my entry
openapi.yml CHANGED@@ -1,96 +1,290 @@1 - openapi: 3.1.02 info:3 - title:SimpleTask-API
4 version: 1.0.05 - description: Simple Api6 - contact: {}7 - license:8 - name: apache 2.09 - identifier: apache-2.010 - url: https://www.apache.org/licenses/LICENSE-2.0.html11
12 servers:13 - - url: https://example.com/14 -
15 paths:16 - /v1/task/{id}:17 -put:18 - summary:DoSimpleTask
19 -operationId:DoSimpleTask
20 responses:21 '200':22 - description:doatask by id23 content:24 application/json:25 schema:26 - $ref: '#/components/schemas/Task'27 - '204':28 - description: No content29 '400':
30 - description:Problemwithdata31 content:32 application/json:33 schema:34 - $ref: '#/components/schemas/Error'35 - '403':
36 - description:NotAuthorized37 content:38 application/json:39 schema:40 - $ref: '#/components/schemas/Unauthorized'41 '404':42 - description: not found43 - content:44 - application/json:45 - schema:46 -schemas/Error'47 - '500':48 - description: Internal server error49 - content:50 - application/json:51 - schema:52 -schemas/Error'
53 - description:Allowstodoasimpletask54 - security:55 - - authorization: []56 parameters:
57 --in: path58 - name: id59 required: true
60 schema:61 type: string
62
63 components:64 schemas:
65 -Task:
66 properties:67 -comments:68 type: string
69 -creationDate:
70 type: string
71 -taskId:
72 type: string
73 -description:74 type: string
75 -lastUpdate:76 type: string
77 type: object78 - additionalProperties: false79 - Error:80 properties:
81 -error:
82 type: string
83 required:84 - -error
85 type: object86 - Unauthorized:87 properties:
88 message:89 type: string90 -required:91 --message
92 -object
93 securitySchemes:94 -authorization:95 type: http96 scheme: bearer
1 + openapi: 3.0.32 info:3 + title: Orders Service API4 + description: API for managing customer orders5 version: 1.0.0
6
7 servers:8 + - url: https://api.example.com/v19 + description: Production server10 + - url: https://staging-api.example.com/v111 + description: Staging server12 +
13 paths:14 + /orders:15 + get:16 + summary: List all orders17 + description: Retrieve a list of orders with optional filtering18 + parameters:19 + - name: status20 + in: query21 + description: Filter orders by status22 + schema:23 + type: string24 + enum: [pending, processing, completed, cancelled]25 + - name: customerId26 + in: query27 + description: Filter orders by customer ID28 + schema:29 + type: string30 + - name: page31 + in: query32 + description: Page number for pagination33 + schema:34 + type: integer35 + minimum: 136 + default: 137 + - name: limit38 + in: query39 + description: Number of items per page40 + schema:41 + type: integer42 + minimum: 143 + maximum: 10044 + default: 2045 responses:46 '200':47 + description: Successfully retrieved orders48 content:49 application/json:50 schema:51 + $ref: '#/components/schemas/OrderList'
52 '400':53 + $ref: '#/components/responses/BadRequest'54 + '401':55 + $ref: '#/components/responses/Unauthorized'56 +
57 + post:58 + summary: Create a new order59 + description: Create a new order for a customer60 + requestBody:61 + required: true62 + content:63 + application/json:64 + schema:65 + $ref: '#/components/schemas/OrderCreate'66 + responses:67 + '201':68 + description: Order created successfully69 content:70 application/json:71 schema:72 + $ref: '#/components/schemas/Order'73 + '400':74 + $ref: '#/components/responses/BadRequest'75 + '401':76 + $ref: '#/components/responses/Unauthorized'77 +
78 + /orders/{orderId}:79 + get:80 + summary: Get order by ID81 + description: Retrieve detailed information about a specific order82 + parameters:83 + - name: orderId84 + in: path85 + required: true86 + description: Unique identifier of the order87 + schema:88 + type: string89 + responses:90 + '200':91 + description: Order found92 content:93 application/json:94 schema:95 + $ref: '#/components/schemas/Order'96 '404':
97 + $ref: '#/components/responses/NotFound'98 + '401':
99 + $ref: '#/components/responses/Unauthorized'100 +
101 + patch:102 + summary: Update order status103 + description: Update the status of an existing order
104 parameters:105 + - name: orderId106 + in: path
107 required: true108 + description: Unique identifier of the order109 schema:110 type: string111 + requestBody:112 + required: true113 + content:114 + application/json:115 + schema:116 + $ref: '#/components/schemas/OrderUpdate'117 + responses:118 + '200':119 + description: Order updated successfully120 + content:121 + application/json:122 + schema:123 + $ref: '#/components/schemas/Order'124 + '400':125 + $ref: '#/components/responses/BadRequest'126 + '404':127 + $ref: '#/components/responses/NotFound'128 + '401':129 + $ref: '#/components/responses/Unauthorized'130
131 components:132 schemas:133 + OrderCreate:134 + type: object135 + required:136 + - customerId137 + - items138 properties:139 + customerId:140 type: string141 + description: Unique identifier of the customer142 + items:143 + type: array144 + items:145 + $ref: '#/components/schemas/OrderItem'146 + shippingAddress:147 + $ref: '#/components/schemas/Address'148 + billingAddress:149 + $ref: '#/components/schemas/Address'150 +
151 + OrderUpdate:152 + type: object153 + required:154 + - status155 + properties:156 + status:157 type: string158 + enum: [pending, processing, completed, cancelled]159 + description: New status of the order160 +
161 + Order:162 + type: object163 + properties:164 + id:165 type: string166 + description: Unique identifier of the order167 + customerId:168 type: string169 + description: Unique identifier of the customer170 + status:171 type: string172 + enum: [pending, processing, completed, cancelled]173 + items:174 + type: array175 + items:176 + $ref: '#/components/schemas/OrderItem'177 + totalAmount:178 + type: number179 + format: float180 + shippingAddress:181 + $ref: '#/components/schemas/Address'182 + billingAddress:183 + $ref: '#/components/schemas/Address'184 + createdAt:185 + type: string186 + format: date-time187 + updatedAt:188 + type: string189 + format: date-time190 +
191 + OrderList:192 type: object
193 properties:194 + items:195 + type: array196 + items:197 + $ref: '#/components/schemas/Order'198 + pagination:199 + $ref: '#/components/schemas/Pagination'200 +
201 + OrderItem:202 + type: object203 + required:204 + - productId205 + - quantity206 + properties:207 + productId:208 type: string209 + quantity:210 + type: integer211 + minimum: 1212 + price:213 + type: number214 + format: float215 + name:216 + type: string217 +
218 + Address:219 + type: object220 required:221 + - street222 + - city223 + - country224 + - postalCode225 + properties:226 + street:227 + type: string228 + city:229 + type: string230 + state:231 + type: string232 + country:233 + type: string234 + postalCode:235 + type: string236 +
237 + Pagination:238 type: object
239 properties:240 + totalItems:241 + type: integer242 + totalPages:243 + type: integer244 + currentPage:245 + type: integer246 + itemsPerPage:247 + type: integer248 +
249 + Error:250 + type: object251 + properties:252 + code:253 + type: string254 message:255 type: string256 + details:257 + type: array258 + items:259 + type: string260 +
261 + responses:262 + BadRequest:263 + description: Invalid request264 + content:265 + application/json:266 + schema:267 + $ref: '#/components/schemas/Error'268 +
269 + Unauthorized:270 + description: Authentication required271 + content:272 + application/json:273 + schema:274 + $ref: '#/components/schemas/Error'275 +
276 + NotFound:277 + description: Resource not found278 + content:279 + application/json:280 + schema:281 + $ref: '#/components/schemas/Error'282 +
283 securitySchemes:284 + BearerAuth:285 type: http286 scheme: bearer287 + bearerFormat: JWT288 +
289 + security:290 + - BearerAuth: [] -
2024-08-01
Something changed