-[x] beverages
- name
- ingredientsQuantityMap -[x] ingredients
- name
- available-amount
- beverage manager/service -[x] add new beverage
- ingredients manager/service -[x] getIngridient -[x] update ingridient -[x] add new ingridient -[x] isAvaliable for checking is ingridient is available.
- Dispenser service (controller) -[x] make_beverage
- beverage reposiotory -[x] Create -[x] Read
- ingredient respository -[x] add -[x] update -[x] read
- ingridients controller -[x] AddNewIngridientAPI -[x] Re-fillIngridientAPI -[x] IsAvailable
- beverage controller -[x] AddNewBeverageAPI
- Dispenser controller -[x] MakeBeverageAPI
- transaction lock manager
-[x] Logging -[x] HttpServerMux -[ ] Monitoring Not asked. -[ ] Security Not asked. -[x] Exception Handling -[x] Utils -[x] Config Management -[x] Dependency Management
- Client OR user of machine
-[x] CRUD bevrages
- Create :
- add entry in begrage repository
- return success
- return error if such repo exists already
- Read :
- Get beverage based on name of bevrage
- Update : Not asked.
- Delete : Not asked.
-[x] CRUD ingredients
- Create :
- call new ingridient api from ingridient manager
- add entry in ingredients repo.
- return error if adding to repo says duplicate entry.
- return success
- read :
- get ingredients data using getIngridient from ingridient manager
- update : using update ingridient from ingridient manager
- decrement by X :
- take lock on ingredient
- update by -X units
- update availibility for an ingridient.
- increment by X :
- take lock on ingredient
- update by -X units
- update availibility for an ingridient.
- decrement by X :
- delete : Not asked.
- Get beverage
- req. contain the outlet no., beverage type
- acquire lock on the outlet using the no. (and decrement the count outlet available for serving not needeed totally)
- Add entry in the orders table as "Requested" Not asked.
- Get beverage data from beverage repo.(get the ingridients req. and quanitity of each),
- if couldn;t find, update to "bad-order" Not asked.
- return error.
- update the ingredients to lock for that many ingridients,
- if any of it fails, fail the order "Unserviceabile", else udpate order to "preparing". Not asked.
- return failure if can;t be serviced.
- return statement : "XYZ is prepared" or somethings, check the ques.
- add ingredients
- acquire lock on ingridient.
- update to +x OR -x, check if the quantity if postive if not return error.
- check which ingredients are finished, track finished ingredients
- READ the ingridients
- start machine
- initantiate dependencies
- add seed data form file
- stop machine : simple Close interrupt for us.
- graceful shutdown ie. serve the one last beverage from machine from each outlet.