Shop Owner can Process an Order
vanmitG opened this issue · comments
We have three stages of Order:
- Placed
- Processing
- Delivered
- Canceled
We'll make a string field called status
on each order Order
model.
Frontend
- Shop Owner can click button to move order from "placed" to "processing" state.
- Shop Owner can click button to move order from "processing" to "delivered" state.
- Shop Owner can click button to move order from any state to "canceled" state.
- Order component needs to show current order status.
- Order component needs to show correct button (Mark as ____).
- Order component always has cancel button, unless order is already canceled.
Backend
- Add status field.
- Add new PUT route
/orders/id/process
to mark order withid
as 'processing". If the order is canceled or in the wrong state, throw error. - Add new PUT route
/orders/id/deliver
to mark order withid
as 'processing". If the order is canceled or in the wrong state, throw error. - Add new PUT route
/orders/id/cancel
to mark order withid
as 'canceled". If the order is canceled or in the wrong state, throw error.