Backend Challenge BTG Pactual (07/2024)
{
"email": "lorem@ipsum.br",
"username": "lorem ipsum"
}
{
"name": "product_name"
"value": 3150,
}
{
"email": "lorem@ipsum.br",
"products": [
{
"name": "product_1",
"quantity": 2
},
{
"name": "product_2",
"quantity": 1
},
{
"name": "product_3",
"quantity": 7
}
]
}
1.0: "Customers" Service
- 1.1: Assigned for creating products, customers, and customer orders.
- 1.2: Order data is stored in PostgreSQL, and then the information is sent via messaging (RabbitMQ exchange) to the "orders" service.
2.0: "Orders" Service.
- 2.1: Assigned for consuming the message sent by the "customers" service.
- 2.2: Data stored in memory (Redis) has a TTL.
- 2.3: Information about orders and messages consumed within a month are persisted to disk.
3.0: The services also communicate via HTTP requests.
- 3.1: CORS prevents the client from directly accessing the "orders" service.