-
Notifications
You must be signed in to change notification settings - Fork 4
Ingredient
- Make sure to download the latest dev.env file and place it in
/config/
. - Go to
/ingredient
, then runnpm i && npm start
.
The ingredient service is responsible for:
- storing information about individual ingredients that make up recipes
- storing user inventories containing owned-ingredients and their quantities
POST /parse
Parses a recipe object
Body
- recipe -
{ ingredients: string[] }
Response
- ingredients - array of ingredient objects, where each ingredient is
{ id: number, quantity: number, name: string }
GET /search?query=...
Perform a search on the ingredient database by name.
GET /ingredient/:id
Retrieve ingredient data based on an ID
POST /ingredient
Add an ingredient to the database
Body
- name
- unitCategory (1 - volume [mL, L,], 2 - weight [g, kg], 3 - units)
PATCH /ingredient/:id
Modify an ingredient within the database
Allowed Updates
- name
- unitCategory
DELETE /ingredient/:id
Delete an ingredient from the database
POST /user
Add a user to the database
Body
- externalId (corresponding user service ID)
DELETE /user/:id
Remove a user from the database
GET /user/ingredient/:id
Retrieve a user's ingredient list (by user ID)
POST /user/ingredient/:id
Add a new ingredient to a user's ingredient list
Body
- ingredientId
- quantity
PATCH /user/ingredient/:id
Update the quantity of an ingredient to a user's ingredient list (by user ID)
Allowed Updates
- quantity
DELETE /user/ingredient/:id
Remove an ingredient from a user's ingredient list (by user ID)