Skip to content

Published Language (PL) Document

Jaafar Alkaales edited this page Aug 5, 2024 · 1 revision

Glossary & Core Concepts:

1- Beverage:

  • id : Unique identifier for the beverage.
  • Beverage Type: The type of beverage (e.g., Coca)
  • Description: Detailed information about a beverage.  a. Brand: The brand of the beverage (e.g., CocaCola).  b. Price: The price of the beverage.

2-Bar:

  • _id: Unique identifier for the bar.
  • Name: The name of the bar.
  • Location: The location of the bar within the event location.
  • Beverage Stock: A collection of beverages currently available at the bar.
  • Orders: List of orders placed at the bar.

3-Warehouse:

  • _id: Unique identifier for the warehouse.
  • Beverages: A collection of beverages stored in the warehouse.
  • Empties: List of orders placed at the bar.
  • Log: A collection of beverages sent to each bar. This collection is caregorized by beverage's type.

4-Drop Point:

  • _id: Unique identifier for the drop point.
  • Location: The location of the drop point within the event.
  • Empties: A list of empty bottles deposited by guests.
  • capacity: The capacity of each drop point based on which it sends notification to warehouse to empty it.
  • log: A list of empty bottles dropped at the respective drop point.

Key Operations:

Replenishment: The process of transferring beverages from the warehouse to the bar to maintain stock levels. Empty Bottle: A bottle that has been used and deposited at a drop point. Order: A request made by a guest at the bar to purchase one or more beverages. Notification: The notification published from Drop Point to warehouse to empty the respective Drop Point. Quantity: The number of beverages is requested by bar from warehouse. It also refers to the number of beverages the visitor ordered.

APIs/Communication Protocols:

1.Replenishment API (Between Warehouse and Bar)

  • Protocol: HTTP/REST
  • Endpoint: POST /api/warehouse/replenishBar
  • Description: This API endpoint allows the warehouse to send beverages to the bar upon request.
  • Data Format: JSON
  • Request Body: { "bevtype":"Coca", "quantity":4, “barName”: “Bar_1” }

bevtype: BeverageType

2.Order API (Within Bar Context):

  • Protocol: HTTP/REST
  • Endpoint: POST /api/order/makeOrder/:barID
  • Description: This API allows guests to place orders at the bar.
  • Data Format: JSON
  • Request Body: { "items": [ { "beverageType": "Coca", "qty": 25 } ] }

qty : Quantity of beverages to be ordered

3.Drop Point API (Between Bar and Drop Point):

  • Protocol: HTTP/REST
  • Endpoint: PUT /api/drop_point/
  • Description: This API endpoint simulates visitors drop empty bottles at drop point.
  • Data Format: JSON
  • Request Body: { "emptyBottles": [ "667b0842a127d973cb15b226", "667b0842a127d973cb15b213" ] } emptyBottles : array of empty bottles come from warehouse.

4.Warehouse API (Between Warehouse and Drop Point):

  • Protocol: HTTP/REST
  • Endpoint: POST api/warehouse/notification
  • Description: This API endpoint simulates Drop Point sending notification to Warehouse to empty the drop point.
  • Data Format: JSON
  • Request Body: No need to specify req body as its generated automatically by the Drop Point service.

General Note:

The system should support replenishment operations, where the warehouse sends beverages to the bar. Each bar should be able to track its beverage stock and orders placed by guests