COP4331-LargeGroupProject-Fall22 / backend

Backend for SmartChef project, see https://github.com/COP4331-LargeGroupProject-Fall22/SmartChef
0 stars 1 forks source link

Add: quantity support #70

Closed mplekunov closed 1 year ago

mplekunov commented 1 year ago

Added quantity support. Now Ingredients carries two additional parameters: quantityUnits: array quantity: IUnit

quantityUnits is an array that describes what kind of units can specific ingredient has. Both IIngredient and IInventoryIngredient should return quantityUnits.

quantity is an object that represents a quantity of particular Ingredient in inventory. Units should be chosen from the quantityUnits.

Reworked body parser. All put and post request now accept application/json, instead of application/x-www-urlencoded.

Reworked return format for Inventory calls, now they return quantity.

Reworked user update call, now if password is being changed/updated, it will be encrypted.

Refactored code in controllers.