microservices-patterns / ftgo-consumer-web-ui

Other
17 stars 28 forks source link

Implement the third page, Select Menu Items #10

Open dartandrevinsky opened 3 years ago

dartandrevinsky commented 3 years ago

Use this sketch as a guideline:

Select Menu Items

dartandrevinsky commented 3 years ago

Presently:

image

dartandrevinsky commented 3 years ago

The above commit backs these UI changes: image

dartandrevinsky commented 3 years ago

Presently the UI looks thus: image

dartandrevinsky commented 3 years ago

Description of the added API endpoints

POST <api>/cart

Description: Creates a new cart object

Body: <empty>

Response:

{
  id, // id of the cart
  items // Array<CartItem>
}

PUT <api>/cart/:cartId

Description: Updated the cart item's quantity or adds one to it

Body:

{ 
  cartId, // id of the current cart
  restaurantId, // id of the restaurant the menu item belongs to
  itemId, // id of the menu item
  qty // desired quantity of the item in the cart
}

Response:

// CartItem:
{
  id,
  count,
  meta: {
    restaurantId
  }
}
dartandrevinsky commented 3 years ago

Empty tray:

image

Tray with Items:

image

Subtotal added:

image