vanmitG / cds-final-flask-shop

A simple back-end e-commerce shop built with flask

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shop Owner can Process an Order

vanmitG opened this issue · comments

We have three stages of Order:

  1. Placed
  2. Processing
  3. Delivered
  4. 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 with id as 'processing". If the order is canceled or in the wrong state, throw error.
  • Add new PUT route /orders/id/deliver to mark order with id as 'processing". If the order is canceled or in the wrong state, throw error.
  • Add new PUT route /orders/id/cancel to mark order with id as 'canceled". If the order is canceled or in the wrong state, throw error.