{ "swagger": "2.0", "info": { "title": "API V1", "version": "v1" }, "basePath": "/api/v1", "definitions": { "menu_recipe_response": { "type": "object", "properties": { "id": { "type": "string", "example": "1" }, "type": { "type": "string", "example": "menu_recipe" }, "attributes": { "type": "object", "properties": { "menu_id": { "type": "integer", "example": 1, "x-nullable": false }, "recipe_quantity": { "type": "integer", "example": 3, "x-nullable": true }, "recipe": { "$ref": "#/definitions/recipe_response" }, "created_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true }, "updated_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true } }, "required": [] } }, "required": [ "id", "type", "attributes" ] }, "menu_recipe": { "type": "object", "properties": { "recipe_id": { "type": "integer", "example": 1, "x-nullable": false }, "recipe_quantity": { "type": "integer", "example": 3, "x-nullable": true } } }, "menu_recipes_collection": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/menu_recipe" } } }, "required": [ "data" ] }, "menu_recipe_resource": { "type": "object", "properties": { "data": { "$ref": "#/definitions/menu_recipe" } }, "required": [ "data" ] }, "recipe_ingredient_response": { "type": "object", "properties": { "id": { "type": "string", "example": "1" }, "type": { "type": "string", "example": "recipe_ingredient" }, "attributes": { "type": "object", "properties": { "recipe_id": { "type": "integer", "example": 1, "x-nullable": false }, "ingredient": { "$ref": "#/definitions/ingredient_response" }, "ingredient_quantity": { "type": "integer", "example": 3, "x-nullable": true }, "ingredient_measure": { "type": "string", "example": "Kilo", "x-nullable": true }, "created_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true }, "updated_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true } }, "required": [] } }, "required": [ "id", "type", "attributes" ] }, "recipe_ingredient": { "type": "object", "properties": { "ingredient_id": { "type": "integer", "example": 1, "x-nullable": false }, "ingredient_quantity": { "type": "integer", "example": 3, "x-nullable": true }, "ingredient_measure": { "type": "string", "example": "Kilo", "x-nullable": true } } }, "recipe_ingredients_collection": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/recipe_ingredient" } } }, "required": [ "data" ] }, "recipe_ingredient_resource": { "type": "object", "properties": { "data": { "$ref": "#/definitions/recipe_ingredient" } }, "required": [ "data" ] }, "recipe_step_update": { "type": "object", "properties": { "step_order_position": { "type": "integer", "example": 2, "x-nullable": false }, "description": { "type": "string", "example": "Prender el horno", "x-nullable": true } } }, "recipe_step_response": { "type": "object", "properties": { "id": { "type": "string", "example": "1" }, "type": { "type": "string", "example": "recipe_step" }, "attributes": { "type": "object", "properties": { "step_order_rank": { "type": "integer", "example": 0, "x-nullable": true }, "description": { "type": "string", "example": "Prender el horno", "x-nullable": true }, "media_url": { "type": "string", "example": "https://some-media-url.com", "x-nullable": true }, "recipe_id": { "type": "integer", "example": 1, "x-nullable": true }, "created_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true }, "updated_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true } }, "required": [] } }, "required": [ "id", "type", "attributes" ] }, "recipe_step": { "type": "object", "properties": { "description": { "type": "string", "example": "Prender el horno", "x-nullable": true } } }, "recipe_steps_collection": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/recipe_step_response" } } }, "required": [ "data" ] }, "recipe_step_resource": { "type": "object", "properties": { "data": { "$ref": "#/definitions/recipe_step_response" } }, "required": [ "data" ] }, "recipe_critical_associations": { "type": "object", "properties": { "menus": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 1 }, "name": { "type": "string", "example": "Menú de almuerzo" }, "portions": { "type": "integer", "example": 5 } } } } } }, "user": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "change_password": { "type": "object", "properties": { "password": { "type": "string" }, "password_confirmation": { "type": "string" } } }, "forgot_password": { "type": "object", "properties": { "email": { "type": "string" } } }, "provider_ingredient": { "type": "object", "properties": { "name": { "type": "string" }, "price": { "type": "string" }, "measure": { "type": "string" }, "provider": { "type": "string" }, "provider_id": { "type": "string" } } }, "cornershop_product": { "type": "object", "properties": { "provider": { "type": "object", "properties": { "id": { "type": "integer", "example": 1 }, "name": { "type": "string", "example": "Jumbo" }, "address": { "type": "string", "example": "Av. Bilbao 223" }, "country": { "type": "string", "example": "CL" } } }, "products": { "type": "array", "items": { "type": "object", "properties": { "price": { "type": "float", "example": 2290.0 }, "measure": { "type": "string", "example": "UN" }, "package": { "type": "string", "example": "600 grs." }, "name": { "type": "string", "example": "Kingsbury - Pan molde perfecto blanco" }, "img_url": { "type": "string", "example": "https://s.cornershopapp.com/img-url" } } } } } }, "ingredient": { "type": "object", "properties": { "provider_name": { "type": "string", "example": "Jumbo", "x-nullable": true }, "name": { "type": "string", "example": "Harina", "x-nullable": true }, "sku": { "type": "string", "example": "SK28CD2", "x-nullable": true }, "price": { "type": "integer", "example": 2990, "x-nullable": true }, "currency": { "type": "string", "example": "CLP", "x-nullable": true }, "inventory": { "type": "float", "example": 10.3, "x-nullable": true }, "minimum_quantity": { "type": "float", "example": 10.3, "x-nullable": true }, "ingredient_measures_attributes": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "example": "Kg", "x-nullable": false }, "quantity": { "type": "float", "example": 1.2, "x-nullable": true } } } } }, "required": [ "name", "price", "currency", "quantity", "measure" ] }, "ingredient_response": { "type": "object", "properties": { "id": { "type": "string", "example": "1" }, "type": { "type": "string", "example": "ingredient" }, "attributes": { "type": "object", "properties": { "provider_name": { "type": "string", "example": "Jumbo", "x-nullable": true }, "user_id": { "type": "integer", "example": 1, "x-nullable": true }, "name": { "type": "string", "example": "Harina", "x-nullable": true }, "sku": { "type": "string", "example": "SK28CD2", "x-nullable": true }, "price": { "type": "integer", "example": 2990, "x-nullable": true }, "currency": { "type": "string", "example": "CLP", "x-nullable": true }, "quantity": { "type": "float", "example": 2.4, "x-nullable": true }, "measure": { "type": "string", "example": "unidad", "x-nullable": true }, "inventory": { "type": "float", "example": 10.3, "x-nullable": true }, "minimum_quantity": { "type": "float", "example": 10.3, "x-nullable": true }, "measures": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/ingredient_measure_response" } } } }, "created_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true }, "updated_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true } }, "required": [] } }, "required": [ "id", "type", "attributes" ] }, "ingredients_collection": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/ingredient_response" } } }, "required": [ "data" ] }, "ingredient_resource": { "type": "object", "properties": { "data": { "$ref": "#/definitions/ingredient_response" } }, "required": [ "data" ] }, "ingredient_critical_associations": { "type": "object", "properties": { "recipes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 1 }, "name": { "type": "string", "example": "Pastel de choclo" }, "portions": { "type": "integer", "example": 4 }, "cook_minutes": { "type": "integer", "example": 25 } } } } } }, "update_inventories_ingredients": { "type": "array", "items": { "type": "object", "properties": { "ingredient_id": { "type": "integer", "example": 5 }, "inventory": { "type": "float", "example": 2.8 } } } }, "provider": { "type": "object", "properties": { "name": { "type": "string", "example": "Jumbo", "x-nullable": true }, "address": { "type": "string", "example": "Av. Francisco Bilbao 223", "x-nullable": true }, "email": { "type": "string", "example": "jumbo@uc.cl", "x-nullable": true }, "phone": { "type": "string", "example": "+56 2 99222122", "x-nullable": true }, "country": { "type": "string", "example": "Chile", "x-nullable": true }, "webpage_url": { "type": "string", "example": "https://jumbo.cl", "x-nullable": true }, "contact_name": { "type": "string", "example": "Marisol Pérez", "x-nullable": true }, "contact_rut": { "type": "string", "example": "11.353.222-3", "x-nullable": true }, "bank_name": { "type": "string", "example": "Banchile", "x-nullable": true }, "account_type": { "type": "string", "example": "Cuenta Corriente", "x-nullable": true }, "account_number": { "type": "string", "example": "0-00-11233322", "x-nullable": true }, "delivery_days": { "type": "integer", "example": 1, "x-nullable": true }, "minimum_purchase": { "type": "integer", "example": 15000, "x-nullable": true } }, "required": [ "name" ] }, "provider_response": { "type": "object", "properties": { "id": { "type": "string", "example": "1" }, "type": { "type": "string", "example": "provider" }, "attributes": { "type": "object", "properties": { "name": { "type": "string", "example": "Jumbo", "x-nullable": true }, "address": { "type": "string", "example": "Av. Francisco Bilbao 223", "x-nullable": true }, "email": { "type": "string", "example": "jumbo@uc.cl", "x-nullable": true }, "phone": { "type": "string", "example": "+56 2 99222122", "x-nullable": true }, "country": { "type": "string", "example": "Chile", "x-nullable": true }, "webpage_url": { "type": "string", "example": "https://jumbo.cl", "x-nullable": true }, "contact_name": { "type": "string", "example": "Marisol Pérez", "x-nullable": true }, "contact_rut": { "type": "string", "example": "11.353.222-3", "x-nullable": true }, "bank_name": { "type": "string", "example": "Banchile", "x-nullable": true }, "account_type": { "type": "string", "example": "Cuenta Corriente", "x-nullable": true }, "account_number": { "type": "string", "example": "0-00-11233322", "x-nullable": true }, "delivery_days": { "type": "integer", "example": 1, "x-nullable": true }, "minimum_purchase": { "type": "integer", "example": 15000, "x-nullable": true }, "created_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true }, "updated_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true } }, "required": [] } }, "required": [ "id", "type", "attributes" ] }, "providers_collection": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/provider_response" } } }, "required": [ "data" ] }, "provider_resource": { "type": "object", "properties": { "data": { "$ref": "#/definitions/provider_response" } }, "required": [ "data" ] }, "menu": { "type": "object", "properties": { "name": { "type": "string", "example": "Menú de almuerzo", "x-nullable": true }, "portions": { "type": "integer", "example": 5, "x-nullable": false }, "menu_recipes_attributes": { "type": "array", "items": { "type": "object", "properties": { "recipe_id": { "type": "integer", "example": 1, "x-nullable": false }, "recipe_quantity": { "type": "integer", "example": 5, "x-nullable": true } } } } }, "required": [ "name" ] }, "menu_update": { "type": "object", "properties": { "name": { "type": "string", "example": "Menú de almuerzo", "x-nullable": true }, "portions": { "type": "integer", "example": 5, "x-nullable": false }, "menu_recipes_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 1, "x-nullable": true }, "recipe_id": { "type": "integer", "example": 1, "x-nullable": false }, "recipe_quantity": { "type": "integer", "example": 5, "x-nullable": true }, "_destroy": { "type": "boolean", "example": false, "x-nullable": true } } } } }, "required": [ "name" ] }, "menu_response": { "type": "object", "properties": { "id": { "type": "string", "example": "1" }, "type": { "type": "string", "example": "menu" }, "attributes": { "type": "object", "properties": { "name": { "type": "string", "example": "Menú de almuerzo", "x-nullable": true }, "created_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true }, "updated_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true }, "menu_recipes": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/menu_recipe_response" } } } } }, "required": [] } }, "required": [ "id", "type", "attributes" ] }, "menus_collection": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/menu_response" } } }, "required": [ "data" ] }, "menu_resource": { "type": "object", "properties": { "data": { "$ref": "#/definitions/menu_response" } }, "required": [ "data" ] }, "recipe": { "type": "object", "properties": { "name": { "type": "string", "example": "Pastel de choclo", "x-nullable": true }, "portions": { "type": "integer", "example": 4, "x-nullable": true }, "cook_minutes": { "type": "integer", "example": 25, "x-nullable": true }, "recipe_ingredients_attributes": { "type": "array", "items": { "type": "object", "properties": { "ingredient_id": { "type": "integer", "example": 2, "x-nullable": false }, "ingredient_quantity": { "type": "integer", "example": 5, "x-nullable": false }, "ingredient_measure": { "type": "string", "example": "Kg", "x-nullable": false } } } }, "steps_attributes": { "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string", "example": "Horneamos la masa", "x-nullable": false }, "media_url": { "type": "string", "example": "https://media-url", "x-nullable": true }, "step_order_position": { "type": "integer", "example": 0, "x-nullable": true } } } } }, "required": [ "name", "portions", "cook_minutes" ] }, "recipe_update": { "type": "object", "properties": { "name": { "type": "string", "example": "Pastel de choclo", "x-nullable": true }, "portions": { "type": "integer", "example": 4, "x-nullable": true }, "cook_minutes": { "type": "integer", "example": 25, "x-nullable": true }, "recipe_ingredients_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 1, "x-nullable": true }, "ingredient_id": { "type": "integer", "example": 2, "x-nullable": false }, "ingredient_quantity": { "type": "integer", "example": 5, "x-nullable": false }, "_destroy": { "type": "boolean", "example": false, "x-nullable": true } } } }, "steps_attributes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "example": 1, "x-nullable": true }, "step_order_position": { "type": "integer", "example": 1, "x-nullable": true }, "description": { "type": "string", "example": "Horneamos la masa", "x-nullable": false }, "media_url": { "type": "string", "example": "https://media-url", "x-nullable": true }, "ingredient_measure": { "type": "string", "example": "Kg", "x-nullable": false }, "_destroy": { "type": "boolean", "example": false, "x-nullable": true } } } } }, "required": [ "name", "portions", "cook_minutes" ] }, "recipes_collection": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/recipe_response" } } }, "required": [ "data" ] }, "recipe_resource": { "type": "object", "properties": { "data": { "$ref": "#/definitions/recipe_response" } }, "required": [ "data" ] }, "recipe_response": { "type": "object", "properties": { "id": { "type": "string", "example": "1" }, "type": { "type": "string", "example": "recipe" }, "attributes": { "type": "object", "properties": { "user_id": { "type": "integer", "example": 1, "x-nullable": true }, "name": { "type": "string", "example": "Pastel de choclo", "x-nullable": true }, "portions": { "type": "integer", "example": 4, "x-nullable": true }, "cook_minutes": { "type": "integer", "example": 25, "x-nullable": true }, "created_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true }, "updated_at": { "type": "string", "example": "1984-06-04 09:00", "x-nullable": true }, "recipe_ingredients": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/recipe_ingredient_response" } } } }, "steps": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/recipe_step_response" } } } } }, "required": [] } }, "required": [ "id", "type", "attributes" ] }, "ingredient_measure_response": { "type": "object", "properties": { "name": { "type": "string", "example": "unidad" }, "quantity": { "type": "integer", "example": 2 }, "primary": { "type": "boolean", "example": true } } } }, "paths": { "/search-jumbo-products": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "query", "in": "query", "type": "string" } ], "get": { "summary": "Search ingredients on Jumbo web", "consumes": [ "application/json" ], "produces": [ "application/json" ], "description": "Retrieves ingredients from Jumbo", "responses": { "200": { "description": "ingredients retrieved", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/provider_ingredient" } } }, "required": [ "data" ] } }, "401": { "description": "user unauthorized" } } } }, "/search-lider-products": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "query", "in": "query", "type": "string" } ], "get": { "summary": "Search ingredients on Lider web", "consumes": [ "application/json" ], "produces": [ "application/json" ], "description": "Retrieves ingredients from Lider", "responses": { "200": { "description": "ingredients retrieved", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/provider_ingredient" } } }, "required": [ "data" ] } }, "401": { "description": "user unauthorized" } } } }, "/search-cornershop-products": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "query", "in": "query", "type": "string" } ], "get": { "summary": "Search products on Cornershop", "consumes": [ "application/json" ], "produces": [ "application/json" ], "description": "Retrieves products from different markets", "responses": { "200": { "description": "products retrieved", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/cornershop_product" } } } } }, "401": { "description": "user unauthorized" } } } }, "/alert-ingredients": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "get": { "summary": "Show alerted ingredients", "consumes": [ "application/json" ], "produces": [ "application/json" ], "description": "Retrieves ingredients with its quantity below minimum", "responses": { "200": { "description": "ingredients retrieved", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/provider_ingredient" } } }, "required": [ "data" ] } }, "401": { "description": "user unauthorized" } } } }, "/ingredients": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "get": { "summary": "Retrieves Ingredients", "description": "Retrieves all the ingredients", "produces": [ "application/json" ], "responses": { "200": { "description": "Ingredients retrieved", "schema": { "$ref": "#/definitions/ingredients_collection" } }, "401": { "description": "user unauthorized" } } }, "post": { "summary": "Creates Ingredient", "description": "Creates Ingredient", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "ingredient", "in": "body", "schema": { "type": "object", "properties": { "ingredient": { "$ref": "#/definitions/ingredient" } }, "required": [ "ingredient" ] } } ], "responses": { "201": { "description": "ingredient created" }, "401": { "description": "user unauthorized" } } } }, "/ingredients/update-inventories": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "post": { "summary": "Updates ingredients inventories", "description": "Updates each ingredient with new inventory", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "ingredients", "in": "body", "schema": { "type": "object", "properties": { "ingredients": { "$ref": "#/definitions/update_inventories_ingredients" } }, "required": [ "ingredients" ] } } ], "responses": { "201": { "description": "ingredients updated" }, "401": { "description": "user unauthorized" } } } }, "/ingredients/{id}": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "id", "in": "path", "type": "integer", "required": true } ], "get": { "summary": "Retrieves Ingredient", "produces": [ "application/json" ], "responses": { "200": { "description": "ingredient retrieved", "schema": { "$ref": "#/definitions/ingredient_resource" } }, "404": { "description": "invalid ingredient id" }, "401": { "description": "user unauthorized" } } }, "put": { "summary": "Updates Ingredient", "description": "Updates Ingredient", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "ingredient", "in": "body", "schema": { "type": "object", "properties": { "ingredient": { "$ref": "#/definitions/ingredient" } }, "required": [ "ingredient" ] } } ], "responses": { "200": { "description": "ingredient updated with measure by default" }, "401": { "description": "user unauthorized" } } }, "delete": { "summary": "Deletes Ingredient", "produces": [ "application/json" ], "description": "Deletes specific ingredient", "responses": { "204": { "description": "ingredient deleted" }, "404": { "description": "ingredient not found" }, "401": { "description": "user unauthorized" } } } }, "/ingredients/{id}/critical-associations": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "id", "in": "path", "type": "integer", "required": true } ], "get": { "summary": "Retrieves Ingredient critical associations for confirming delete", "produces": [ "application/json" ], "responses": { "200": { "description": "ingredient associations retrieved", "schema": { "$ref": "#/definitions/ingredient_critical_associations" } }, "404": { "description": "invalid ingredient id" }, "401": { "description": "user unauthorized" } } } }, "/menus/{menu_id}/menu_recipes": { "parameters": [ { "name": "menu_id", "in": "path", "type": "integer", "required": true }, { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "post": { "summary": "Creates Menu Recipe", "description": "Creates Menu Recipe", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "menu_recipe", "in": "body", "schema": { "type": "object", "properties": { "menu_recipe": { "$ref": "#/definitions/menu_recipe" } }, "required": [ "menu_recipe" ] } } ], "responses": { "201": { "description": "menu_recipe created" }, "401": { "description": "user unauthorized" }, "404": { "description": "recipe not found" } } } }, "/menus/{menu_id}/menu_recipes/{id}": { "parameters": [ { "name": "menu_id", "in": "path", "type": "integer", "required": true }, { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "id", "in": "path", "type": "integer", "required": true } ], "put": { "summary": "Updates Menu Recipe", "description": "Updates Menu Recipe", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "menu_recipe", "in": "body", "schema": { "type": "object", "properties": { "menu_recipe": { "$ref": "#/definitions/menu_recipe" } }, "required": [ "menu_recipe" ] } } ], "responses": { "200": { "description": "menu_recipe updated" }, "401": { "description": "user unauthorized" } } }, "delete": { "summary": "Deletes Menu Recipe", "produces": [ "application/json" ], "description": "Deletes specific menu_recipe", "responses": { "204": { "description": "menu_recipe deleted" }, "404": { "description": "menu_recipe not found" }, "401": { "description": "user unauthorized" } } } }, "/menus": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "get": { "summary": "Retrieves Menus", "description": "Retrieves all the menus", "produces": [ "application/json" ], "responses": { "200": { "description": "Menus retrieved", "schema": { "$ref": "#/definitions/menus_collection" } } } }, "post": { "summary": "Creates Menu", "description": "Creates Menu", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "menu", "in": "body", "schema": { "type": "object", "properties": { "menu": { "$ref": "#/definitions/menu" } }, "required": [ "menu" ] } } ], "responses": { "201": { "description": "menu created" }, "404": { "description": "recipe not of user" } } } }, "/menus/{id}": { "parameters": [ { "name": "id", "in": "path", "type": "integer", "required": true }, { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "get": { "summary": "Retrieves Menu", "produces": [ "application/json" ], "responses": { "200": { "description": "menu retrieved", "schema": { "$ref": "#/definitions/menu_resource" } }, "404": { "description": "invalid menu id" } } }, "put": { "summary": "Updates Menu", "description": "Updates Menu", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "menu", "in": "body", "schema": { "type": "object", "properties": { "menu": { "$ref": "#/definitions/menu_update" } }, "required": [ "menu" ] } } ], "responses": { "200": { "description": "menu updated" } } }, "delete": { "summary": "Deletes Menu", "produces": [ "application/json" ], "description": "Deletes specific menu", "responses": { "204": { "description": "menu deleted" }, "404": { "description": "menu not found" } } } }, "/menus/{id}/reduce-inventory": { "parameters": [ { "name": "id", "in": "path", "type": "integer", "required": true }, { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "post": { "summary": "Reduces inventory", "description": "Reduces inventory of ingredients of menu through recipes", "consumes": [ "application/json" ], "produces": [ "application/json" ], "responses": { "200": { "description": "reduced inventory of menu" } } } }, "/menus/{id}/shopping-list": { "parameters": [ { "name": "id", "in": "path", "type": "integer", "required": true }, { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "get": { "summary": "Returns Menu Ingredients, same as shopping list", "description": "Get ingredients of a menu with quantities, prices, measures grouped by provider", "consumes": [ "application/json" ], "produces": [ "application/json" ], "responses": { "200": { "description": "shopping list grouped by provider with default measure" } } } }, "/providers": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "get": { "summary": "Retrieves Providers", "description": "Retrieves all the providers", "produces": [ "application/json" ], "responses": { "200": { "description": "Providers retrieved", "schema": { "$ref": "#/definitions/providers_collection" } }, "401": { "description": "user unauthorized" } } }, "post": { "summary": "Creates Provider", "description": "Creates Provider", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "provider", "in": "body", "schema": { "type": "object", "properties": { "provider": { "$ref": "#/definitions/provider" } }, "required": [ "provider" ] } } ], "responses": { "201": { "description": "provider created" }, "401": { "description": "user unauthorized" } } } }, "/providers/{id}": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "id", "in": "path", "type": "integer", "required": true } ], "get": { "summary": "Retrieves Provider", "produces": [ "application/json" ], "responses": { "200": { "description": "provider retrieved", "schema": { "$ref": "#/definitions/provider_resource" } }, "404": { "description": "invalid provider id" }, "401": { "description": "user unauthorized" } } }, "put": { "summary": "Updates Provider", "description": "Updates Provider", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "provider", "in": "body", "schema": { "type": "object", "properties": { "provider": { "$ref": "#/definitions/provider" } }, "required": [ "provider" ] } } ], "responses": { "200": { "description": "provider updated" }, "401": { "description": "user unauthorized" } } }, "delete": { "summary": "Deletes Provider", "produces": [ "application/json" ], "description": "Deletes specific provider", "responses": { "204": { "description": "provider deleted" }, "404": { "description": "provider not found" }, "401": { "description": "user unauthorized" } } } }, "/recipes/{recipe_id}/recipe_ingredients": { "parameters": [ { "name": "recipe_id", "in": "path", "type": "integer", "required": true }, { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "post": { "summary": "Creates Recipe Ingredient", "description": "Creates Recipe Ingredient", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "recipe_ingredient", "in": "body", "schema": { "type": "object", "properties": { "recipe_ingredient": { "$ref": "#/definitions/recipe_ingredient" } }, "required": [ "recipe_ingredient" ] } } ], "responses": { "201": { "description": "recipe_ingredient created" }, "401": { "description": "user unauthorized" }, "404": { "description": "ingredient is not of user" } } } }, "/recipes/{recipe_id}/recipe_ingredients/{id}": { "parameters": [ { "name": "recipe_id", "in": "path", "type": "integer", "required": true }, { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "id", "in": "path", "type": "integer", "required": true } ], "put": { "summary": "Updates Recipe Ingredient", "description": "Updates Recipe Ingredient", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "recipe_ingredient", "in": "body", "schema": { "type": "object", "properties": { "recipe_ingredient": { "$ref": "#/definitions/recipe_ingredient" } }, "required": [ "recipe_ingredient" ] } } ], "responses": { "200": { "description": "recipe_ingredient updated" }, "401": { "description": "user unauthorized" }, "404": { "description": "ingredient is not of user" } } }, "delete": { "summary": "Deletes Recipe Ingredient", "produces": [ "application/json" ], "description": "Deletes specific recipe_ingredient", "responses": { "204": { "description": "recipe_ingredient deleted" }, "404": { "description": "recipe_ingredient not found" }, "401": { "description": "user unauthorized" } } } }, "/recipes/{recipe_id}/recipe_steps": { "parameters": [ { "name": "recipe_id", "in": "path", "type": "integer", "required": true }, { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "post": { "summary": "Creates Recipe Step", "description": "Creates Recipe Step", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "recipe_step", "in": "body", "schema": { "type": "object", "properties": { "recipe_step": { "$ref": "#/definitions/recipe_step" } }, "required": [ "recipe_step" ] } } ], "responses": { "201": { "description": "recipe_step created" }, "401": { "description": "user unauthorized" } } } }, "/recipes/{recipe_id}/recipe_steps/{id}": { "parameters": [ { "name": "recipe_id", "in": "path", "type": "integer", "required": true }, { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "id", "in": "path", "type": "integer", "required": true } ], "put": { "summary": "Updates Recipe Step", "description": "Updates Recipe Step", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "recipe_step", "in": "body", "schema": { "type": "object", "properties": { "recipe_step": { "$ref": "#/definitions/recipe_step_update" } }, "required": [ "recipe_step" ] } } ], "responses": { "200": { "description": "recipe_step updated" }, "401": { "description": "user unauthorized" } } }, "delete": { "summary": "Deletes Recipe Step", "produces": [ "application/json" ], "description": "Deletes specific recipe_step", "responses": { "204": { "description": "recipe_step deleted" }, "404": { "description": "recipe_step not found" }, "401": { "description": "user unauthorized" } } } }, "/recipes": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "get": { "summary": "Retrieves Recipes", "description": "Retrieves all the recipes", "produces": [ "application/json" ], "responses": { "200": { "description": "Recipes retrieved", "schema": { "$ref": "#/definitions/recipes_collection" } }, "401": { "description": "user unauthorized" } } }, "post": { "summary": "Creates Recipe", "description": "Creates Recipe", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "recipe", "in": "body", "schema": { "type": "object", "properties": { "recipe": { "$ref": "#/definitions/recipe" } }, "required": [ "recipe" ] } } ], "responses": { "201": { "description": "recipe created" }, "401": { "description": "user unauthorized" } } } }, "/recipes/{id}": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "id", "in": "path", "type": "integer", "required": true } ], "get": { "summary": "Retrieves Recipe", "produces": [ "application/json" ], "responses": { "200": { "description": "recipe retrieved", "schema": { "$ref": "#/definitions/recipe_resource" } }, "404": { "description": "invalid recipe id" }, "401": { "description": "user unauthorized" } } }, "put": { "summary": "Updates Recipe", "description": "Updates Recipe", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "recipe", "in": "body", "schema": { "type": "object", "properties": { "recipe": { "$ref": "#/definitions/recipe_update" } }, "required": [ "recipe" ] } } ], "responses": { "200": { "description": "recipe updated" }, "401": { "description": "user unauthorized" } } }, "delete": { "summary": "Deletes Recipe", "produces": [ "application/json" ], "description": "Deletes specific recipe", "responses": { "204": { "description": "recipe deleted" }, "404": { "description": "recipe not found" }, "401": { "description": "user unauthorized" } } } }, "/recipes/{id}/critical-associations": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" }, { "name": "id", "in": "path", "type": "integer", "required": true } ], "get": { "summary": "Retrieves recipe critical associations for confirming delete", "produces": [ "application/json" ], "responses": { "200": { "description": "recipe associations retrieved", "schema": { "$ref": "#/definitions/recipe_critical_associations" } }, "404": { "description": "invalid recipe id" }, "401": { "description": "user unauthorized" } } } }, "/users/registrations": { "post": { "summary": "Create user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "user", "in": "body", "schema": { "type": "object", "properties": { "user": { "$ref": "#/definitions/user" } }, "required": [ "user" ] } } ], "responses": { "201": { "description": "user created" } } } }, "/users/change-password": { "parameters": [ { "name": "user_email", "in": "query", "type": "string" }, { "name": "user_token", "in": "query", "type": "string" } ], "post": { "summary": "Changes password of user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "user", "in": "body", "schema": { "type": "object", "properties": { "user": { "$ref": "#/definitions/change_password" } }, "required": [ "user" ] } } ], "responses": { "201": { "description": "password correctly updated" }, "400": { "description": "new password and confirmation are not the same" } } } }, "/users/forgot-password": { "post": { "summary": "Send email for recover password tro user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "user", "in": "body", "schema": { "type": "object", "properties": { "user": { "$ref": "#/definitions/forgot_password" } }, "required": [ "user" ] } } ], "responses": { "201": { "description": "recover password email correctly sent" } } } }, "/users/sessions": { "post": { "summary": "Log in", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "user", "in": "body", "schema": { "type": "object", "properties": { "user": { "$ref": "#/definitions/user" } }, "required": [ "user" ] } } ], "responses": { "200": { "description": "logged in" } } } } } }