alejandroaizel / obento_api

GNU General Public License v3.0
1 stars 0 forks source link

Recipe API #5

Closed jlmpepe closed 2 years ago

jlmpepe commented 2 years ago

Description API CRUD methods for recipe creation.

Use cases

Interface Changes

New API methods:

Description Method Endpoint Body Returns
Get recipe GET /api/v1/recipes/@recipe_id JSON
Get all recipes GET /api/v1/recipes JSON Array
Create new recipe POST /api/v1/recipes JSON INT (recipe_id)
Delete recipe DELETE /api/v1/recipes/@recipe_id HTTP Response code

Additional Context

IMPORTANT: Recipes can be private or public. Private recipes are those that only their owner can use for generate menus. Public recipes are those that any user can use the recipe for generate menus.

Recipe model data:

TYPE NAME
INT ID
VARCHAR NAME
VARCHAR DESCRIPTION
VARCHAR STEPS
INT COOKING_TIME
TINYINT IS_LUNCH
VARCHAR IMAGE_PATH
BIGINT UNSIGNED TOTAL_STARS
BIGINT UNSIGNED NUM_SCORES
INT CATEGORY_ID

Compound model data:

TYPE NAME
BIGINT ID
DOUBLE QUANTITY
INT INGREDIENT_ID
INT RECIPE_ID

Ingredient model data:

TYPE NAME
INT ID
VARCHAR NAME
VARCHAR CATEGORY
VARCHAR UNIT
DOUBLE UNITARY_PRICE
DOUBLE KCALORIES
VARCHAR ICON_NAME

RecipeCategory model data:

TYPE NAME
INT ID
VARCHAR DESCRIPTION

Progress Status