-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathapi.http
78 lines (61 loc) · 1.43 KB
/
api.http
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
### Products
GET http://localhost:3000/products
###
POST http://localhost:3000/products
Content-Type: application/json
{
"name": "Product 1",
"quantity": 10,
"price": 100
}
###
@product_id = 7f485799-dad6-4b26-a1c3-1fb960f25e88
### Customers
GET http://localhost:3000/customers
###
POST http://localhost:3000/customers
Content-Type: application/json
{
"name": "Customer 1",
"email": "[email protected]",
"address": "Customer Address",
"phone": "123456789"
}
###
@customer_id = 7fd77a71-a9af-4d97-938a-f8ba2f0d3a0e
### Orders
GET http://localhost:3000/orders
###
POST http://localhost:3000/orders
Content-Type: application/json
{
"customer_id": "{{customer_id}}",
"items": [
{
"product_id": "{{product_id}}",
"quantity": 1
}
]
}
# orders --- sincrono (criacao do pedido, criacao da fatura, pagamento)
# processos de longa duração -
# order orquestrator service
# order created -> invoice created -> invoice payed -> order approved
# -> invoice rejected -> order canceled -> enviar mail
# orquestação e coerografia
# orders -- assincrona - enviar o evento de integração via rabbitmq --- mailer
## processar o pedido
#OrderCreated
#InvoiceCreated
#InvoicePayed
#OrderApproved
//---
#DebitEvent
#CreditEvent - 31/01/2023 (saldo daquele dia)
# snapshot (instantaneo) Conta - 1000
#CreditEvent
#DebitEvent
#
#
#
# - 20/06/2023