Skip to content

fighting-dreamer/brew_machine

Repository files navigation

Resources :

-[x] beverages

  1. name
  2. ingredientsQuantityMap -[x] ingredients
  3. name
  4. available-amount

Services :

  1. beverage manager/service -[x] add new beverage
  2. ingredients manager/service -[x] getIngridient -[x] update ingridient -[x] add new ingridient -[x] isAvaliable for checking is ingridient is available.
  3. Dispenser service (controller) -[x] make_beverage
  4. beverage reposiotory -[x] Create -[x] Read
  5. ingredient respository -[x] add -[x] update -[x] read
  6. ingridients controller -[x] AddNewIngridientAPI -[x] Re-fillIngridientAPI -[x] IsAvailable
  7. beverage controller -[x] AddNewBeverageAPI
  8. Dispenser controller -[x] MakeBeverageAPI
  9. transaction lock manager

Other Aspects :

-[x] Logging -[x] HttpServerMux -[ ] Monitoring Not asked. -[ ] Security Not asked. -[x] Exception Handling -[x] Utils -[x] Config Management -[x] Dependency Management

other related project :

  1. Client OR user of machine

Processes :

-[x] CRUD bevrages

  1. Create :
    1. add entry in begrage repository
    2. return success
    3. return error if such repo exists already
  2. Read :
    1. Get beverage based on name of bevrage
  3. Update : Not asked.
  4. Delete : Not asked.

-[x] CRUD ingredients

  1. Create :
    1. call new ingridient api from ingridient manager
    2. add entry in ingredients repo.
    3. return error if adding to repo says duplicate entry.
    4. return success
  2. read :
    1. get ingredients data using getIngridient from ingridient manager
  3. update : using update ingridient from ingridient manager
    1. decrement by X :
      1. take lock on ingredient
      2. update by -X units
      3. update availibility for an ingridient.
    2. increment by X :
      1. take lock on ingredient
      2. update by -X units
      3. update availibility for an ingridient.
  4. delete : Not asked.
  5. Get beverage
    • req. contain the outlet no., beverage type
    1. acquire lock on the outlet using the no. (and decrement the count outlet available for serving not needeed totally)
    2. Add entry in the orders table as "Requested" Not asked.
    3. Get beverage data from beverage repo.(get the ingridients req. and quanitity of each),
    4. if couldn;t find, update to "bad-order" Not asked.
    5. return error.
    6. update the ingredients to lock for that many ingridients,
      1. if any of it fails, fail the order "Unserviceabile", else udpate order to "preparing". Not asked.
    7. return failure if can;t be serviced.
    8. return statement : "XYZ is prepared" or somethings, check the ques.
  6. add ingredients
    1. acquire lock on ingridient.
    2. update to +x OR -x, check if the quantity if postive if not return error.
  7. check which ingredients are finished, track finished ingredients
    1. READ the ingridients
  8. start machine
    1. initantiate dependencies
    2. add seed data form file
  9. stop machine : simple Close interrupt for us.
    1. graceful shutdown ie. serve the one last beverage from machine from each outlet.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published