Commit 42904bec authored by Darrick Yong's avatar Darrick Yong

fix buttons and README

parent 4be642aa
...@@ -17,27 +17,42 @@ ...@@ -17,27 +17,42 @@
--- ---
## Details ## Details
#### Schema ### Schemas
#### Warehouse Order
``` ```
{ {
_id: String id: String,
orderId: String orderId: String,
status: String "unfulfilled" (default) > "fulfilled"/"cancelled" status: String "RECEIVED" (default) > "FULFILLED"/"CANCELLED",
orderObject?: (will have it on initial Kafka message, not sure if we need to store this) createdAt: Date,
modifiedAt: Date,
orderItems: List<Item>,
address: String,
} }
``` ```
#### Workflow #### Item
- Warehouse Management (WM) expects an Order object (?) from Order Management (OM) on order placement in Kafka. ```
- On receipt of an Order object, WM will create a warehouse order entry in database with a status of "unfulfilled." {
itemId: String,
itemName: String,
itemQuantity: int,
itemPrice: float,
itemSku: int,
}
```
### Workflow
- Warehouse Management (WM) expects an Order object from Order Management (OM) on order creation in Kafka.
- On receipt of an Order object, WM will create a warehouse order entry in database with a status of **"RECEIVED"**.
- In the WM UI, a warehouse manager will have the ability to fulfill or cancel unfulfilled orders. - In the WM UI, a warehouse manager will have the ability to fulfill or cancel unfulfilled orders.
- When an order is marked **"fulfilled"** or **"cancelled"**, a Kafka message will be sent to be consumed. - When an order is marked **"FULFILLED"** or **"CANCELLED"**, a Kafka message will be sent to be consumed.
#### UI ### UI
- Login - Login/Logout
- Order status update screen mark orders as fulfilled or cancelled - Order Status and Update orders as **"FULFILLED"** or **"CANCELLED"**
- Order search - Order Filter and Search
- Order information page - Order Details
#### API Documentation #### API Documentation
https://documenter.getpostman.com/view/7402212/TzRNGATe https://documenter.getpostman.com/view/7402212/TzRNGATe
...@@ -5,19 +5,21 @@ import Button from "../atoms/Button"; ...@@ -5,19 +5,21 @@ import Button from "../atoms/Button";
const OrderButtons = ({ order, editOrder }) => { const OrderButtons = ({ order, editOrder }) => {
const FULFILLED = "FULFILLED";
const CANCELLED = "CANCELLED";
const handleUpdate = (action) => { const handleUpdate = (action) => {
console.log(action); if (action === FULFILLED) {
if (action === "FULFILL") { editOrder({ ...order, status: FULFILLED });
editOrder({ ...order, status: "FULFILLED" }); } else if (action === CANCELLED) {
} else if (action === "CANCEL") { editOrder({ ...order, status: CANCELLED });
editOrder({ ...order, status: "CANCELLED" });
} }
}; };
return ( return (
<div className="oii-buttons"> <div className="oii-buttons">
<Button className="fulfill-btn" onClick={() => handleUpdate("FULFILL")} text="Fulfill"/> <Button className="fulfill-btn" onClick={() => handleUpdate(FULFILLED)} text="Fulfill"/>
<Button className="cancel-btn" onClick={() => handleUpdate("CANCEL")} text="Cancel"/> <Button className="cancel-btn" onClick={() => handleUpdate(CANCELLED)} text="Cancel"/>
</div> </div>
); );
}; };
......
...@@ -12,10 +12,10 @@ public class Item { ...@@ -12,10 +12,10 @@ public class Item {
private String itemId; private String itemId;
private String itemName; private String itemName;
private int itemQuantity; private int itemQuantity;
private double itemPrice; private float itemPrice;
private int itemSku; private int itemSku;
public Item(String itemId, String itemName, int itemQuantity, double itemPrice, int itemSku) { public Item(String itemId, String itemName, int itemQuantity, float itemPrice, int itemSku) {
this.itemId = itemId; this.itemId = itemId;
this.itemName = itemName; this.itemName = itemName;
this.itemQuantity = itemQuantity; this.itemQuantity = itemQuantity;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment