-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBanking Microservice App.postman_collection.json
340 lines (340 loc) · 10.3 KB
/
Banking Microservice App.postman_collection.json
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
{
"info": {
"_postman_id": "8263fe4e-4f77-47b4-91cb-3e242f9d3dde",
"name": "Banking Microservice App",
"description": "This collection contains two Microservices\n\n1. **Banking :** Open new account for customer \n Making a Deposit or Withdrawal Transaction in the accounts.\n2. **Auth-Banking :** This service is use to apply security & authorization to above banking application.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "18769640"
},
"item": [
{
"name": "Auth-Banking",
"item": [
{
"name": "Admin Login",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"username\": \"admin\",\r\n \"password\": \"abc123\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3001/auth/login",
"protocol": "http",
"host": [
"localhost"
],
"port": "3001",
"path": [
"auth",
"login"
]
},
"description": "An Admin have below rights :\n\n1. View all customers.\n2. View a single customer details by ID.\n3. Create new account for a customer.\n4. Making a deposit or withdrawal transaction for a customer's account."
},
"response": []
},
{
"name": "User Login",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"username\": \"2000\",\r\n \"password\": \"abc123\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3001/auth/login",
"protocol": "http",
"host": [
"localhost"
],
"port": "3001",
"path": [
"auth",
"login"
]
},
"description": "User role can do :\n\n- View his own customer details.\n \n\n- Make a withdrawal or deposit transaction for his own existing account."
},
"response": []
}
],
"description": "This collection is for generating access tokens before making a request from the main banking application to perform any action. User & Admin login API will generate an access token which can be passed to **Authorization Bearer Token** while making banking request**.**"
},
{
"name": "Banking",
"item": [
{
"name": "New Account",
"item": [
{
"name": "Saving",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"account_type\" :\"saving\",\r\n \"amount\":5000\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/customers/2001/account",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"customers",
"2001",
"account"
]
}
},
"response": []
},
{
"name": "Checking",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcl9pZCI6IiIsImFjY291bnRzIjpudWxsLCJ1c2VybmFtZSI6ImFkbWluIiwicm9sZSI6ImFkbWluIiwiZXhwIjoxNjY2NTE3Nzk5fQ.T0zYjHsWD08_G2WiOlw4XP4HR8vw-bPQJTYoVi6Mgus",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"account_type\" :\"checking\",\r\n \"amount\":5000\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/customers/2000/account",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"customers",
"2000",
"account"
]
}
},
"response": []
}
],
"description": "A new account can be opening for an existing customer though below APIs. Only admins can open a new account for any user.\n\n[http://localhost:3000/customers/{customer_id}/account](https://desktop.postman.com/?desktopVersion=10.0.1&userId=18769640&teamId=0)\n\n- New account can be of type **saving** or **checking** only.\n- Minimum deposit of 5000 is necessary to open a new account otherwise error will be returned."
},
{
"name": "Transaction",
"item": [
{
"name": "Deposit",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"transaction_type\":\"deposit\",\r\n \"amount\":1000 \r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/customers/2000/account/95470",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"customers",
"2000",
"account",
"95470"
]
},
"description": "This API is for making a new deposit transaction to an existing account in below format\n\n[http://localhost:3000/customers/{customer_id}/account/{account_id}](http://localhost:3000/customers/{customer_id}/account/{account_id})"
},
"response": []
},
{
"name": "Withdrawal",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcl9pZCI6IjIwMDAiLCJhY2NvdW50cyI6WyI5NTQ3MCJdLCJ1c2VybmFtZSI6IjIwMDAiLCJyb2xlIjoidXNlciIsImV4cCI6MTY2NjUxNjA4OH0.8hH6Loi7uqD8N1Eib0ochvvV2yJZLk_bMtHC6waJbGM",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"transaction_type\":\"withdrawal\",\r\n \"amount\":1000 \r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/customers/2000/account/95470",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"customers",
"2000",
"account",
"95470"
]
},
"description": "This API is for making a new withdrawal transaction to an existing account in below format\n\n[http://localhost:3000/customers/{customer_id}/account/{account_id}](http://localhost:3000/customers/{customer_id}/account/{account_id})"
},
"response": []
}
],
"description": "This API is for making a new transaction to an existing account in below format\n\n[http://localhost:3000/customers/{customer_id}/account/{account_id}](http://localhost:3000/customers/{customer_id}/account/{account_id})\n\n- Transaction type can be deposit or withdrawal only.\n- Successful transaction returns updated balance with transaction id in response.\n- Amount cannot be negative and withdrawal amount should be available as balance in account."
},
{
"name": "View Customer",
"item": [
{
"name": "Fetch Customer By ID",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/customers/2001",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"customers",
"2001"
]
},
"description": "This API is for viewing a customer by ID.\n\n[http://localhost:3000/customers/{customer_id}](http://localhost:3000/customers/{customer_id})\n\n- An admin has right to view any user.\n- User can only view his own account. A user cannot access other user details.\n- Authorization Bearer Token should be passed before making the request."
},
"response": []
},
{
"name": "Fetch Customer List",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcl9pZCI6IiIsImFjY291bnRzIjpudWxsLCJ1c2VybmFtZSI6ImFkbWluIiwicm9sZSI6ImFkbWluIiwiZXhwIjoxNjY2MTcwMTY0fQ.6bVLGb8bisRW-689WQX-ZeUyDDANeGiBVlqGVAkYZag",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/customers",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"customers"
]
},
"description": "This API is for viewing all the customers list which can be only viewed by admin users only. Request should contain a valid bearer token."
},
"response": []
}
],
"description": "This collection is for viewing customer details."
}
],
"description": "#### Banking service is responsible for below functionality provided via API endpoints.\n\n- Open new account for customer\n- Making a Deposit or Withdrawal Transaction in the accounts.\n- View all the accounts or a single account detail."
}
]
}