Skip to content

Commit

Permalink
docs: update response object structure and event naming in README
Browse files Browse the repository at this point in the history
  • Loading branch information
italopessoa committed Nov 23, 2024
1 parent d3ea771 commit eb4c539
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,24 @@ Repository with Kitchen production line resources
- **Response Object**:
```json
{
"received": ["ASD-12","ASD-22"],
"inPreparation": ["ASD-02","ASD-42"],
"ready": ["ASD-X3"]
"received": [
{
"orderId": "b39c3d69-2e43-47df-8b86-0037975ae211",
"code": "ASD-12"
}
],
"inPreparation":[
{
"orderId": "b33c3d69-2e43-47df-8b86-0037975ae211",
"code": "ASD-12"
}
],
"ready": [
{
"orderId": "c39c3d69-2e43-47df-8b86-0037975ae211",
"code": "ASD-22"
}
],
}
```

Expand All @@ -43,37 +58,40 @@ Repository with Kitchen production line resources
- Status changes cannot be rolled back.
- If the order status is `Completed`, it should be removed from the orders list.
- **Events**:
- An `OrderStatusUpdated` event should be triggered on every status change operation.
- An `OrderStatusChanged` event should be triggered on every status change operation.

# Use Cases

## ReceiveOrderUseCase
- **Trigger**: Executed from the `OrderPaymentConfirmed` event.
- **Actions**:
- Adds the order to the `Received` queue.
- Publishes an `OrderStatusUpdated` event with the status value `Received`.
- Publishes an `OrderStatusChanged` event with the status value `Received`.

## PrepareOrderUseCase
- **Trigger**: Executed when an order needs to be prepared.
- **Actions**:
- Removes the order from the `Received` queue.
- Adds the order to the `InPreparation` queue.
- Publishes an `OrderStatusUpdated` event with the status value `InPreparation`.
- Publishes an `OrderStatusChanged` event with the status value `InPreparation`.

## FinishOrderPreparationUseCase
- **Trigger**: Executed when an order preparation is finished.
- **Actions**:
- Removes the order from the `InPreparation` queue.
- Adds the order to the `Ready` queue.
- Publishes an `OrderStatusUpdated` event with the status value `Ready`.
- Publishes an `OrderStatusChanged` event with the status value `Ready`.

## CompleteOrderUseCase
- **Trigger**: Executed when an order is completed.
- **Actions**:
- Removes the order from the `Ready` queue.
- Removes the order from the list.
- Publishes an `OrderStatusUpdated` event with the status value `Completed`.
- Publishes an `OrderStatusChanged` event with the status value `Completed`.

## This repo on the infrastructure

![Architecture Diagram](aws-infra-phase-4.png)
![Architecture Diagram](doc/aws-infra-phase-4.png)

### K8S
![Architecture Diagram](doc/k8s.png)
File renamed without changes
Binary file added doc/k8s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eb4c539

Please sign in to comment.