-
Notifications
You must be signed in to change notification settings - Fork 29
/
ms-transactions.yaml
123 lines (118 loc) · 2.69 KB
/
ms-transactions.yaml
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
openapi: 3.0.0
info:
title: Microservice Wallet
version: 1.0.0
servers:
- url: http://localhost:3001
description: Local
tags:
- name: Transactions
paths:
# Transactions
/transactions:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Transactions'
tags:
- Transactions
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionsModel'
description: Response
'401':
$ref: '#/components/responses/UnauthorizedError'
security:
- bearerAuth: []
get:
tags:
- Transactions
security:
- bearerAuth: []
parameters:
- in: query
name: type
schema:
type: string
responses:
200:
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TransactionsModel'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Transactions
/balance:
get:
description: Esse endpoint deve retornar um consolidado das transações de CREDITO e DEBITO, fazendo o calculo do valor, de prefência que seja uma query fazendo o calculo
tags:
- Transactions
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/BalanceResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
security:
- bearerAuth: []
components:
schemas:
Transactions:
type: object
required:
- user_id
- type
- amount
properties:
user_id:
type: string
amount:
type: integer
type:
type: string
enum:
- CREDIT
- DEBIT
TransactionsModel:
type: object
required:
- user_id
- type
- amount
properties:
id:
type: string
user_id:
type: string
amount:
type: integer
type:
type: string
enum:
- CREDIT
- DEBIT
BalanceResponse:
type: object
properties:
amount:
type: integer
securitySchemes:
bearerAuth: # arbitrary name for the security scheme
type: http
scheme: bearer
bearerFormat: JWT
responses:
UnauthorizedError:
description: Access token is missing or invalid