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.0
    2
      info:
    3
    - title: Simple Task - API
     
    4
      version: 1.0.0
    5
    - description: Simple Api
    6
    - contact: {}
    7
    - license:
    8
    - name: apache 2.0
    9
    - identifier: apache-2.0
    10
    - url: https://www.apache.org/licenses/LICENSE-2.0.html
    11
     
    12
      servers:
    13
    - - url: https://example.com/
    14
    -
     
     
     
    15
      paths:
    16
    - /v1/task/{id}:
    17
    - put:
    18
    - summary: Do Simple Task
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    19
    - operationId: DoSimpleTask
     
     
     
     
     
    20
      responses:
    21
      '200':
    22
    - description: do a task by id
    23
      content:
    24
      application/json:
    25
      schema:
    26
    - $ref: '#/components/schemas/Task'
    27
    - '204':
    28
    - description: No content
    29
      '400':
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    30
    - description: Problem with data
    31
      content:
    32
      application/json:
    33
      schema:
    34
    - $ref: '#/components/schemas/Error'
    35
    - '403':
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    36
    - description: Not Authorized
    37
      content:
    38
      application/json:
    39
      schema:
    40
    - $ref: '#/components/schemas/Unauthorized'
    41
      '404':
    42
    - description: not found
    43
    - content:
    44
    - application/json:
    45
    - schema:
    46
    - $ref: '#/components/schemas/Error'
    47
    - '500':
    48
    - description: Internal server error
    49
    - content:
    50
    - application/json:
    51
    - schema:
    52
    - $ref: '#/components/schemas/Error'
     
     
     
    53
    - description: Allows to do a simple task
    54
    - security:
    55
    - - authorization: []
    56
      parameters:
     
    57
    - - in: path
    58
    - name: id
    59
      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: object
    78
    - additionalProperties: false
    79
    - Error:
    80
      properties:
     
     
     
     
     
     
     
     
     
    81
    - error:
     
     
     
     
    82
      type: string
     
     
     
     
     
     
     
     
     
     
     
    83
      required:
    84
    - - error
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    85
      type: object
    86
    - Unauthorized:
    87
      properties:
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    88
      message:
    89
      type: string
    90
    - required:
    91
    - - message
     
    92
    - type: object
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    93
      securitySchemes:
    94
    - authorization:
    95
      type: http
    96
      scheme: bearer
     
     
     
     
     
    1
    + openapi: 3.0.3
    2
      info:
    3
    + title: Orders Service API
    4
    + description: API for managing customer orders
    5
      version: 1.0.0
     
     
     
     
     
     
    6
     
    7
      servers:
    8
    + - url: https://api.example.com/v1
    9
    + description: Production server
    10
    + - url: https://staging-api.example.com/v1
    11
    + description: Staging server
    12
    +
    13
      paths:
    14
    + /orders:
    15
    + get:
    16
    + summary: List all orders
    17
    + description: Retrieve a list of orders with optional filtering
    18
    + parameters:
    19
    + - name: status
    20
    + in: query
    21
    + description: Filter orders by status
    22
    + schema:
    23
    + type: string
    24
    + enum: [pending, processing, completed, cancelled]
    25
    + - name: customerId
    26
    + in: query
    27
    + description: Filter orders by customer ID
    28
    + schema:
    29
    + type: string
    30
    + - name: page
    31
    + in: query
    32
    + description: Page number for pagination
    33
    + schema:
    34
    + type: integer
    35
    + minimum: 1
    36
    + default: 1
    37
    + - name: limit
    38
    + in: query
    39
    + description: Number of items per page
    40
    + schema:
    41
    + type: integer
    42
    + minimum: 1
    43
    + maximum: 100
    44
    + default: 20
    45
      responses:
    46
      '200':
    47
    + description: Successfully retrieved orders
    48
      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 order
    59
    + description: Create a new order for a customer
    60
    + requestBody:
    61
    + required: true
    62
    + content:
    63
    + application/json:
    64
    + schema:
    65
    + $ref: '#/components/schemas/OrderCreate'
    66
    + responses:
    67
    + '201':
    68
    + description: Order created successfully
    69
      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 ID
    81
    + description: Retrieve detailed information about a specific order
    82
    + parameters:
    83
    + - name: orderId
    84
    + in: path
    85
    + required: true
    86
    + description: Unique identifier of the order
    87
    + schema:
    88
    + type: string
    89
    + responses:
    90
    + '200':
    91
    + description: Order found
    92
      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 status
    103
    + description: Update the status of an existing order
     
     
    104
      parameters:
    105
    + - name: orderId
    106
    + in: path
     
    107
      required: true
    108
    + description: Unique identifier of the order
    109
      schema:
    110
      type: string
    111
    + requestBody:
    112
    + required: true
    113
    + content:
    114
    + application/json:
    115
    + schema:
    116
    + $ref: '#/components/schemas/OrderUpdate'
    117
    + responses:
    118
    + '200':
    119
    + description: Order updated successfully
    120
    + 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: object
    135
    + required:
    136
    + - customerId
    137
    + - items
    138
      properties:
    139
    + customerId:
    140
      type: string
    141
    + description: Unique identifier of the customer
    142
    + items:
    143
    + type: array
    144
    + 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: object
    153
    + required:
    154
    + - status
    155
    + properties:
    156
    + status:
    157
      type: string
    158
    + enum: [pending, processing, completed, cancelled]
    159
    + description: New status of the order
    160
    +
    161
    + Order:
    162
    + type: object
    163
    + properties:
    164
    + id:
    165
      type: string
    166
    + description: Unique identifier of the order
    167
    + customerId:
    168
      type: string
    169
    + description: Unique identifier of the customer
    170
    + status:
    171
      type: string
    172
    + enum: [pending, processing, completed, cancelled]
    173
    + items:
    174
    + type: array
    175
    + items:
    176
    + $ref: '#/components/schemas/OrderItem'
    177
    + totalAmount:
    178
    + type: number
    179
    + format: float
    180
    + shippingAddress:
    181
    + $ref: '#/components/schemas/Address'
    182
    + billingAddress:
    183
    + $ref: '#/components/schemas/Address'
    184
    + createdAt:
    185
    + type: string
    186
    + format: date-time
    187
    + updatedAt:
    188
    + type: string
    189
    + format: date-time
    190
    +
    191
    + OrderList:
    192
      type: object
     
     
    193
      properties:
    194
    + items:
    195
    + type: array
    196
    + items:
    197
    + $ref: '#/components/schemas/Order'
    198
    + pagination:
    199
    + $ref: '#/components/schemas/Pagination'
    200
    +
    201
    + OrderItem:
    202
    + type: object
    203
    + required:
    204
    + - productId
    205
    + - quantity
    206
    + properties:
    207
    + productId:
    208
      type: string
    209
    + quantity:
    210
    + type: integer
    211
    + minimum: 1
    212
    + price:
    213
    + type: number
    214
    + format: float
    215
    + name:
    216
    + type: string
    217
    +
    218
    + Address:
    219
    + type: object
    220
      required:
    221
    + - street
    222
    + - city
    223
    + - country
    224
    + - postalCode
    225
    + properties:
    226
    + street:
    227
    + type: string
    228
    + city:
    229
    + type: string
    230
    + state:
    231
    + type: string
    232
    + country:
    233
    + type: string
    234
    + postalCode:
    235
    + type: string
    236
    +
    237
    + Pagination:
    238
      type: object
     
    239
      properties:
    240
    + totalItems:
    241
    + type: integer
    242
    + totalPages:
    243
    + type: integer
    244
    + currentPage:
    245
    + type: integer
    246
    + itemsPerPage:
    247
    + type: integer
    248
    +
    249
    + Error:
    250
    + type: object
    251
    + properties:
    252
    + code:
    253
    + type: string
    254
      message:
    255
      type: string
    256
    + details:
    257
    + type: array
    258
    + items:
    259
    + type: string
    260
    +
    261
    + responses:
    262
    + BadRequest:
    263
    + description: Invalid request
    264
    + content:
    265
    + application/json:
    266
    + schema:
    267
    + $ref: '#/components/schemas/Error'
    268
    +
    269
    + Unauthorized:
    270
    + description: Authentication required
    271
    + content:
    272
    + application/json:
    273
    + schema:
    274
    + $ref: '#/components/schemas/Error'
    275
    +
    276
    + NotFound:
    277
    + description: Resource not found
    278
    + content:
    279
    + application/json:
    280
    + schema:
    281
    + $ref: '#/components/schemas/Error'
    282
    +
    283
      securitySchemes:
    284
    + BearerAuth:
    285
      type: http
    286
      scheme: bearer
    287
    + bearerFormat: JWT
    288
    +
    289
    + security:
    290
    + - BearerAuth: []
  • 2024-08-01

    Something changed