{ "openapi": "3.0.0", "info": { "title": "API SmartCanteen documentation", "description": "SmartCanteen application support api documentation", "contact": { "name": "Teste", "email": "teste@teste.com" }, "version": "1.0.0" }, "servers": [ { "url": "http://localhost:3000/api/v1", "description": "Local docs" }, { "url": "https://smartcanteen-api.herokuapp.com/api/v1", "description": "Productions docs" } ], "paths": { "/consumer/favoriteMeals/{mealId}": { "post": { "summary": "Add meal to favorites", "description": "Adds a new favorite dish to the consumer", "tags": ["Favorite Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "Meal id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Meal does not exists": { "value": { "msg": "Meal does not exists" } }, "Bars are not the same": { "value": { "msg": "Bars are not the same" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "favoritemealid": { "type": "string" }, "uid": { "type": "string" }, "mealid": { "type": "string" } } }, "examples": { "Add meal to favorites": { "value": [ { "favoritemealid": "578e1026-b2c5-433a-93ea-7f07f399f598", "uid": "f263dee2-2dd6-4006-a819-0457f615592c", "mealid": "04720b43-2c3b-4c78-baef-fcada0a40baa" } ] } } } } } } }, "delete": { "summary": "Remove a meal from favorites", "description": "Remove a specific meal from the favorites of the authenticated user", "tags": ["Favorite Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "Meal id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "FavMeal does not exists": { "value": { "msg": "FavMeal does not exists" } }, "Favmeal does not belong to you": { "value": { "msg": "Favmeal does not belong to you" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK" } } } }, "/campus": { "get": { "summary": "get campus", "description": "Get a specific meal from the favorites of the authenticated user", "tags": ["campus"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "FavMeal does not exists": { "value": { "msg": "FavMeal does not exists" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "campusid": { "type": "string" }, "name": { "type": "string" } } } } } } } } }, "/consumer/favoriteMeal/{favMealId}": { "get": { "summary": "Get one favorite meal", "description": "Get a specific meal from the favorites of the authenticated user", "tags": ["Favorite Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "favMealId", "in": "path", "description": "Favorite Meal id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "FavMeal does not exists": { "value": { "msg": "FavMeal does not exists" } }, "Favmeal does not belong to you": { "value": { "msg": "Favmeal does not belong to you" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "name": { "type": "string" }, "preparationTime": { "type": "number" }, "description": { "type": "string" }, "url": { "type": "string" } } }, "examples": { "Get one favorite meal": { "value": [ { "name": "bacalhau com natas", "preparationTime": 30, "price": 1, "url": null } ] } } } } } } } }, "/consumer/favoriteMeals": { "get": { "summary": "Get all the favorite meals", "description": "Get all the favorite meals of the authenticated user", "tags": ["Favorite Meal"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "orders": { "type": "array", "items": { "properties": { "name": { "type": "string" }, "preparationTime": { "type": "number" }, "price": { "type": "number" }, "url": { "type": "string" } } } } } }, "examples": { "Get all the favorite meals": { "value": [ { "name": "panado", "preparationtime": 30, "price": 5, "url": null } ] } } } } } } } }, "/bar/{barId}/meals": { "get": { "summary": "See meals from a bar", "description": "See meals from a bar ", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "barId", "in": "path", "description": "bar id", "required": true, "schema": { "properties": { "barId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Bar not exist": { "value": { "msg": "Bar not exist" } }, "Bars are not the same": { "value": { "msg": "Bars are not the same" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "cart": { "type": "array", "items": { "properties": { "mealid": { "type": "string" }, "barid": { "type": "string" }, "name": { "type": "string" }, "preparationtime": { "type": "number" }, "description": { "type": "string" }, "cantakeaway": { "type": "boolean" }, "price": { "type": "number" }, "isdeleted": { "type": "boolean" }, "canbemade": { "type": "boolean" } } } } } }, "examples": { "See meals from a bar": { "value": [ { "mealid": "04720b43-2c3b-4c78-baef-fcada0a40baa", "barid": "a91aa933-440b-4c80-beef-f4cadd1aefff", "name": "panado", "preparationtime": 30, "description": "panado com batata", "cantakeaway": true, "price": 5, "isdeleted": false, "canbemade": true } ] } } } } } } } }, "/meals/{mealId}": { "get": { "summary": "See meals detail from a bar", "description": "See meals detail from a bar ", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "meal id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR" }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "See meals detail": { "value": { "msg": "meals detail" } } } } } } } } }, "/consumer/meals/{cartMealId}": { "delete": { "summary": "delete from cart", "description": "delete from cart ", "tags": ["Meal cart"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "cartMealId", "in": "path", "description": "cart meal id", "required": true, "schema": { "properties": { "cartMealId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "CartMeal dont exist": { "value": { "msg": "CartMeal dont exist" } }, "The cart dont belongs to this user": { "value": { "msg": "The cart dont belongs to this user" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "cart": { "type": "array", "items": { "properties": { "cartid": { "type": "string" }, "uid": { "type": "string" }, "date": { "type": "string" }, "iscompleted": { "type": "boolean" } } } } } }, "examples": { "Delete a meal from cart": { "value": [ { "cartid": "4eb6a316-8e9d-4b84-9456-18ae901f8be8", "uid": "f263dee2-2dd6-4006-a819-0457f615592c", "date": "2022-06-10 00:00:00", "iscompleted": true } ] } } } } } } } }, "/consumer/cart/meals": { "get": { "summary": "See cart", "description": "See all details of a cart ", "tags": ["Cart"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "cartid": { "type": "string" }, "uid": { "type": "string" }, "date": { "type": "string" }, "iscompleted": { "type": "boolean" } } }, "examples": { "See cart": { "value": [ { "cartid": "4eb6a316-8e9d-4b84-9456-18ae901f8be8", "uid": "f263dee2-2dd6-4006-a819-0457f615592c", "date": "2022-06-10 00:00:00", "iscompleted": true } ] } } } } } } } }, "/employee/create/meal/": { "post": { "summary": "Create meal", "description": "create meal", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Meal" }, "examples": { "Create Meal": { "value": { "name": "bife com batatas", "preparationTime": 30, "description": "prego", "canTakeaway": true, "price": 0.02, "allowedChanges": [ { "ingname": "atum", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementlimit": 2, "decrementlimit": 1 }, { "ingname": "fiambre", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementedlimit": 2, "decrementedlimit": 1 }, { "ingname": "ovo", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementedlimit": 2, "decrementedlimit": 1 } ] } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Bar dont exist": { "value": { "msg": "Bar dont exist" } }, "Bars are not the same": { "value": { "msg": "Bars are not the same" } }, "Meal already exists": { "value": { "msg": "Meal already exists" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Meal" }, "examples": { "Create Meal": { "value": [ { "name": "bife com batata", "preparationTime": 30, "description": "prego", "canTakeaway": true, "price": 0.02, "allowedChanges": [ { "ingname": "atum", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementlimit": 2, "decrementlimit": 1 }, { "ingname": "salada", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementlimit": 2, "decrementlimit": 1 } ] } ] } } } } } } } }, "/consumer/cart/{mealId}": { "post": { "summary": "Add cart meal", "description": "Add cart meal", "tags": ["Cart"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "meal id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "requestBody": { "content": { "application/json": { "schema": { }, "examples": { "Add meal cart": { "value": { "amount": 1, "changes": [ { "changeId": "3dba1f00-fced-49f7-921b-786cbb02b270", "changeAmount":1 } ] } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } } } } }, "/profile": { "get": { "summary": "View my profile", "description": "This route allows a user of the application to view his profile", "tags": ["Profile"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "name": { "type": "string" }, "campusname": { "type": "string" }, "barname": { "type": "string" }, "imgurl": { "type": "string" } } }, "examples": { "View my profile": { "value": [ { "name": "José Ferreira", "campusname": "Barcelos", "barname": "EST", "imgurl": null } ] } } } } } } }, "put": { "summary": "Edit profile", "description": "Edit the profile of the authenticated user", "tags": ["Profile"], "security": [{ "basicAuth": [] }], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Profile" }, "examples": { "Edit Profile": { "value": { "preferredCampus": "13be23c1-2e9b-43fc-acaa-839c6b3573bc", "preferredBar": "0d9c0499-f2f8-44d5-9b49-a0529266433a", "imgUrl": "teste" } } } } } }, "responses": { "500": { "description": "Invalid Data" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "preferredcampus": { "type": "string" }, "preferredbar": { "type": "string" }, "imgurl": { "type": "string" } } }, "examples": { "Edit profile": { "value": [ { "preferredcampus": "Barcelos", "preferredbar": "EST", "imgurl": null } ] } } } } } } } }, "/employee/meal/{mealId}": { "put": { "summary": "Edit meal", "description": "edit meal", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "bar id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Meal" }, "examples": { "Edit Meal": { "value": { "name": "bife com batatas", "preparationTime": 30, "description": "prego", "canTakeaway": true, "price": 0.02, "allowedChanges": [ { "ingname": "atum", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementedlimir": 2, "decrementedlimit": 1 }, { "ingname": "fiambre", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementedlimit": 2, "decrementedlimit": 1 }, { "ingname": "ovo", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementedlimit": 2, "decrementedlimit": 1 } ] } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Meal does not exists": { "value": { "msg": "Meal does not exists" } }, "Bars are not the same": { "value": { "msg": "Bars are not the same" } }, "Meal already exists in this bar": { "value": { "msg": "Meal already exists in this bar" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Meal" }, "examples": { "Edit meal": { "value": [ { "name": "bife com batata", "preparationTime": 30, "description": "prego", "canTakeaway": true, "price": 0.02, "allowedChanges": [ { "ingname": "atum", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementlimit": 2, "decrementlimit": 1 }, { "ingname": "salada", "ingdosage": "porção", "isremoveonly": true, "canbeincremented": true, "canbedecremented": true, "incrementlimit": 2, "decrementlimit": 1 } ] } ] } } } } } } }, "delete": { "summary": "Remove a meal", "description": "Remove a meal from a bar", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "meal id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Meal does not exists": { "value": { "msg": "Meal does not exists" } }, "Bars are not the same": { "value": { "msg": "Bars are not the same" } }, "Impossible to remove the meal": { "value": { "msg": "Impossible to remove the meal" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK" } } } }, "/consumer/tickets": { "get": { "summary": "Get all orders", "description": "Get all the orders of the authenticated user", "tags": ["Tickets"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "orders": { "type": "array", "items": { "$ref": "#/components/schemas/Order" } } } }, "examples": { "Get all orders": { "value": [ { "ticketid": "534cf037-6a41-475b-81d8-c90af631084f", "nencomenda": 123, "ticketamount": 2, "total": 20, "name": "Preparação" } ] } } } } } } } }, "/consumer/tickets/{ticketId}": { "delete": { "summary": "Remove an order", "description": "Remove a specific order from the authenticated user", "tags": ["Tickets"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "ticketId", "in": "path", "description": "Ticket id", "required": true, "schema": { "properties": { "ticketId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Remove an order that doesnt exist": { "value": { "msg": "Order does not exist!" } }, "Remove an order that isnt yours": { "value": { "msg": "Not your Order!" } }, "Remove an order that is already in preparation": { "value": { "msg": "Order Already in preperation!" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Remove an order": { "value": { "msg": "Order removed successfully" } } } } } } } } }, "/employee/tickets": { "get": { "summary": "Get all orders of the bar", "description": "Get all the orders of the bar where the authenticated user works", "tags": ["Tickets"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "orders": { "type": "array", "items": { "properties": { "ticketid": { "type": "string" }, "nencomenda": { "type": "number" }, "name": { "type": "string" }, "statename": { "type": "string" } } } } } }, "examples": { "Get all orders of the bar": { "value": [ { "ticketid": "534cf037-6a41-475b-81d8-c90af631084f", "name": "Preparação", "statename": 2, "total": 20 } ] } } } } } } } }, "/campus/bar/{campusId}": { "get": { "summary": "Get all bar from campus", "description": "Get all bar from campus", "tags": ["campus"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "campusId", "in": "path", "description": "campus id", "required": true, "schema": { "properties": { "campusId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR" }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Get all orders": { "value": { "msg": "Successfully obtained all details meal from an ticket" } } } } } } } } }, "/ticket/{ticketId}/detail": { "get": { "summary": "Get details meal of an order", "description": "Get details od an order", "tags": ["Tickets"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "ticketId", "in": "path", "description": "Ticket id", "required": true, "schema": { "properties": { "ticketId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR" }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Get all orders": { "value": { "msg": "Successfully obtained all details meal from an ticket" } } } } } } } } }, "/consumer/trades/available": { "get": { "summary": "Get all trades available", "description": "Get all the trades available", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "trades": { "type": "array", "items": { "properties": { "ticketid": { "type": "string" }, "uid": { "type": "string" }, "stateid": { "type": "string" }, "paymentmethodid": { "type": "string" }, "barid": { "type": "string" }, "cartid": { "type": "string" }, "emissondate": { "type": "string" }, "pickuptime": { "type": "string" }, "istakingaway": { "type": "boolean" }, "istrading": { "type": "boolean" }, "ticketamount": { "type": "number" }, "total": { "type": "number" }, "nencomenda": { "type": "number" }, "isdeleted": { "type": "boolean" } } } } } }, "examples": { "Get all trades available": { "value": [ { "ticketid": "534cf037-6a41-475b-81d8-c90af631084f", "uid": "f263dee2-2dd6-4006-a819-0457f615592c", "stateid": "95e3cef7-2f05-4c05-95ad-781a2ca29426", "paymentmethodid": "57f7066e-e2a8-45bd-bad3-7f6773b2e26b", "barid": "0d9c0499-f2f8-44d5-9b49-a0529266433a", "cartid": "4eb6a316-8e9d-4b84-9456-18ae901f8be8", "emissondate": "2022-10-05 00:00:00", "pickuptime": "2022-10-06 00:00:00", "istakingaway": false, "istrading": false, "ticketamount": 2, "total": 30, "nencomenda": 123, "isdeleted": false } ] } } } } } } } }, "/consumer/trades": { "get": { "summary": "See all trades history", "description": "See all trades history", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Get all orders": { "value": { "msg": "Successfully obtained all trades history" } } } } } } } } }, "/consumer/trades/{ticketId}": { "put": { "summary": "Accept trade", "description": "A user can accept or decline an exchange proposal made by another user", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "ticketId", "in": "path", "description": "Ticket id", "required": true, "schema": { "properties": { "ticketId": { "type": "string" } } } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "receptorDecision": { "type": "number" } } }, "examples": { "Accept Trade": { "value": { "receptorDecision": 1 } } } } } }, "responses": { "500": { "description": "Invalid Data" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "isconfirmed": { "type": "boolean" }, "confirmationdate": { "type": "string" }, "receptorDecision": { "type": "number" } } }, "examples": { "Accept Trade": { "value": [ { "isconfirmed": true, "confirmationdate": "2022-10-05", "receptordecision": 1 } ] } } } } } } }, "delete": { "summary": "Cancel ticket trading", "description": "A consumer can cancel his ticket from trading", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "ticketId", "in": "path", "description": "Ticket Id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Cancel trading an order that doesnt exist": { "value": { "msg": "Order does not exist!" } }, "Cancel trading an order that isnt yours": { "value": { "msg": "Not your Order!" } }, "Cancel trading an order that isnt trading": { "value": { "msg": "Order not trading!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "msg": { "value": "Trade exposed successfully" } } } } } } } }, "/login": { "post": { "summary": "Login", "description": "A user can do login", "tags": ["Authentication"], "requestBody": { "content": { "application/json": { "schema": { "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "examples": { "Employee": { "value": { "email": "employe@employee.com", "password": "Teste_#" } }, "Consumer": { "value": { "email": "consumer@consumer.com", "password": "Teste#" } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Login Error": { "value": { "msg": "Wrong Credentials!" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "token": { "type": "string" }, "role": { "type": "string" } } }, "examples": { "Login Success": { "value": { "token": "Session Token", "role": "employee" } } } } } } } } }, "/logout": { "get": { "summary": "Logout", "description": "A user can do logout", "tags": ["Authentication"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Logout": { "value": { "msg": "Logout successful" } } } } } } } } }, "/newSessionToken": { "get": { "summary": "New Session Token", "description": "A user can generate a new session token", "tags": ["Authentication"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "token": { "type": "string" } } }, "examples": { "Logout": { "value": { "token": "session token" } } } } } } } } }, "/consumer/notifications": { "get": { "summary": "Get all notifications", "description": "A user can get all his notifications", "tags": ["Notifications"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "notifications": { "type": "array", "items": { "$ref": "#/components/schemas/Notification" } } } }, "examples": { "Notifications": { "value": [ { "notiid": "uid", "date": "09:44:38.33929+00", "receiverid": "uid", "senderid": "uid", "description": "Notification body", "isseen": false, "istradeproposal": false } ] } } } } } } } }, "/employee/meal/{mealId}/canBeMade": { "put": { "summary": "Indicate that meal can be or not be made", "description": "An employee can indicate that meal can be or not be made", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "Meal Id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "status": { "type": "boolean" } } }, "examples": { "Can Be Made": { "value": { "status": true } }, "Cannot Be Made": { "value": { "status": false } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "msg": { "value": "Meal doesn't exist" } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "msg": { "value": "Meal updated" } } } } } } } }, "/employee/tickets/{ticketId}/{stateId}": { "put": { "summary": "Edit ticket state", "description": "A employee can edit the state of an ticket that belongs to the same bar", "tags": ["Tickets"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "ticketId", "in": "path", "description": "Ticket id", "required": true, "schema": { "properties": { "ticketId": { "type": "string" } } } }, { "name": "stateId", "in": "path", "description": "Ticket id", "required": true, "schema": { "properties": { "stateId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Ticket does not exists": { "value": { "msg": "Ticket does not exists" } }, "State does not exists": { "value": { "msg": "State does not exists" } }, "Bars are not the same": { "value": { "msg": "Bars are not the same" } }, "The ticket has already been delivered": { "value": { "msg": "The ticket has already been delivered" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "ticketid": { "type": "string" }, "stateid": { "type": "string" } } }, "examples": { "Edit ticket state": { "value": { "ticketid": "42977dd1-cfbe-4e0d-a8b0-db1619decb30", "stateid": "5669f7ec-4991-4dee-a1f4-9b944580ac33" } } } } } } } } }, "/employee/bar/{barId}/statistics": { "get": { "summary": "Get bar statistics", "description": "An employee can get his bar statistics", "tags": ["Canteen"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "barId", "in": "path", "description": "Bar Id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Another Bar": { "value": "Cannot get statistics from another bar" }, "Missing parameter": { "value": "Some parameter is incorrect" } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "totalTickets": { "type": "integer" }, "deliveredTickets": { "type": "integer" }, "toDeliverTickets": { "type": "integer" }, "tradedTickets": { "type": "integer" } } }, "examples": { "msg": { "value": { "totalTickets": 3, "deliveredTickets": 1, "toDeliverTickets": 2, "tradedTickets": 2 } } } } } } } } }, "/consumer/trades/{ticketId}/direct": { "put": { "summary": "Make direct trade with user", "description": "A consumer can make a direct trade with another user", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "ticketId", "in": "path", "description": "Ticket Id", "required": true, "schema": { "properties": { "ticketId": { "type": "string" } } } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "receiverEmail": { "type": "string" }, "isFree": { "type": "boolean" }, "paymentMethodId": { "type": "string" } } }, "examples": { "Edit ticket state": { "value": { "receiverEmail": "consumer@consumer.com", "isFree": false, "paymentMethodId": "57f7066e-e2a8-45bd-bad3-7f6773b2e26b" } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Trade an order with a user that doesnt exist": { "value": { "msg": "User does not exist!" } }, "Trade an order with a employee": { "value": { "msg": "Can only trade with another consumer" } }, "Trade an order that doesnt exist": { "value": { "msg": "Order does not exist!" } }, "Trade an order that isnt yours": { "value": { "msg": "Not your Order!" } }, "Trade an order that is already in preparation": { "value": { "msg": "Order Already in preperation!" } }, "Trade with the same user again": { "value": { "msg": "Trade proposal to this user already sent!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "msg": { "value": "Trade proposal done successfully" } } } } } } } }, "/consumer/trades/{ticketId}/general": { "put": { "summary": "Expose order for general trading", "description": "A consumer can expose his order for general trading", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "ticketId", "in": "path", "description": "Ticket Id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "paymentMethodId": { "type": "string" }, "isFree": { "type": "boolean" } } }, "examples": { "Edit ticket state": { "value": { "isFree": false, "paymentMethodId": "57f7066e-e2a8-45bd-bad3-7f6773b2e26b" } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Trade an order with a user that doesnt exist": { "value": { "msg": "User does not exist!" } }, "Trade an order that doesnt exist": { "value": { "msg": "Order does not exist!" } }, "Trade an order that isnt yours": { "value": { "msg": "Not your Order!" } }, "Trade with the same user again": { "value": { "msg": "Order already trading!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "msg": { "value": "Trade exposed successfully" } } } } } } } }, "/consumer/cart/{cartId}/complete": { "post": { "summary": "Complete cart", "description": "A consumer can complete his cart", "tags": ["Cart"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "cartId", "in": "path", "description": "Cart Id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "paymentmethodid": { "type": "string" }, "barid": { "type": "string" }, "ticketAmount": { "type": "string" }, "pickuptime": { "type": "string" }, "istakingaway": { "type": "string" } } }, "examples": { "Complete cart": { "value": { "paymentmethodid": "57f7066e-e2a8-45bd-bad3-7f6773b2e26b", "barid": "0d9c0499-f2f8-44d5-9b49-a0529266433a", "ticketAmount": 1, "pickuptime": "2022-10-06 13:20:00", "istakingaway": true } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Trade an order with a user that doesnt exist": { "value": { "msg": "Cart does not exist!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "msg": { "value": "Cart completed successfully" } } } } } } } }, "/register": { "post": { "summary": "Register user", "description": "Allows an user to regiter", "tags": ["Authentication"], "requestBody": { "content": { "application/json": { "schema": { "properties": { "roleid": { "type": "string" }, "preferredcampus": { "type": "string" }, "preferredbar": { "type": "string" }, "email": { "type": "string" }, "name": { "type": "string" }, "password": { "type": "string" }, "schoolno": { "type": "string" }, "birthdate": { "type": "string" }, "imgurl": { "type": "string" } } }, "examples": { "Register Consumer": { "value": { "roleid": "68271d1d-a6ab-46a3-a498-e2dda2850083", "preferredcampus": "3b30ea61-1565-4fdc-8329-24b70511452b", "preferredbar": "ec3b5a78-16c4-4cfc-b7b5-efc64ddc0c70", "email": "consumer2@consumer.com", "name": "consumer2", "password": "Teste#", "schoolno": 1222, "birthdate": "1999-10-10", "imgurl": null } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } }, "Register with existing email": { "value": { "msg": "Email already registered!" } }, "Register with existing schoolno": { "value": { "msg": "School number already registered!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "msg": { "value": "User Registered Successfully" } } } } } } } }, "/campus/bars": { "get": { "summary": "Get bars in preferred campus", "description": "Allows an user to get bars in preferred campus", "tags": ["Campus"], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "Bars": { "type": "array", "items": { "properties": { "barid": { "type": "string" }, "name": { "type": "string" } } } } } }, "examples": { "Bars": {} } } } } } } }, "/consumer/general/trades/{generalTradeId}": { "get": { "summary": "Accept General Trade", "description": "Allows an user to accept a general trade", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "generalTradeId", "in": "path", "description": "Ticket Id", "required": true, "schema": { "properties": { "generalTradeId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } }, "delete": { "summary": "Cancel General Trade", "description": "Allows an user to cancel a general trade", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "generalTradeId", "in": "path", "description": "Ticket Id", "required": true, "schema": { "properties": { "generalTradeId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } }, "/consumer/mytrades": { "get": { "summary": "See my trades history", "description": "Allows an user to see his trades history", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } }, "/device": { "post": { "summary": "Register user device", "description": "Allows to register user device", "tags": ["Authentication"], "security": [{ "basicAuth": [] }], "requestBody": { "content": { "application/json": { "schema": { "properties": { "token": { "type": "string" } } }, "examples": { "Register Consumer": { "value": { "token": "token" } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } }, "/paymentmethods": { "get": { "summary": "See all payment methods", "description": "Allows an user to see all payment methods", "tags": ["Payment Methods"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } }, "/states": { "get": { "summary": "Get All States", "description": "Allows an user to get state", "tags": ["States"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "Bars": { "type": "array", "items": { "properties": { "barid": { "type": "string" }, "name": { "type": "string" } } } } } }, "examples": { "Bars": {} } } } } } } }, "/consumer/general/trade/{generalTradeId}": { "get": { "summary": "Get Trade Payment Method", "description": "Allows an user to see a trade payment method", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "generalTradeId", "in": "path", "description": "Ticket Id", "required": true, "schema": { "properties": { "generalTradeId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } }, "/employee/bar/menu/": { "get": { "summary": "Get Employee menu", "description": "Allows an employee to get bar menu", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } }, "/meals/{mealId}/allowedChanges": { "get": { "summary": "Get AllowedChanges From a Meal", "description": "Allows an consumer to see all the allowed changes that he can make in a meal", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "Meal Id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } }, "/employee/meals/{mealId}/allowedchanges": { "post": { "summary": "Add Allowed Changes Into a Meal", "description": "Allows an consumer to add allowed changes into a meal", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "Meal Id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } } ], "requestBody": { "content": { "application/json": { "schema": { "properties": { "ingname": { "type": "string" }, "ingdosage": { "type": "string" }, "isremoveonly": { "type": "boolean" }, "canbeincremented": { "type": "boolean" }, "canbedecremented": { "type": "boolean" }, "incrementlimit": { "type": "number" }, "decrementlimit": { "type": "number" }, "deafultValue": { "type": "number" } } }, "examples": { "Adicionar refeição ao cart": { "value": { "ingname": "ovo", "ingdosage": "teste", "isremoveonly": true, "canbeincremented": false, "canbedecremented": false, "incrementlimit": null, "decrementlimit": null, "defaultValue":0 } } } } } }, "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } }, "/employee/meals/{mealId}/allowedchanges/{changeId}": { "delete": { "summary": "Delete Allowed Changes From a Meal", "description": "Allows an consumer to delete a allowed changes from a meal", "tags": ["Meal"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "mealId", "in": "path", "description": "Meal Id", "required": true, "schema": { "properties": { "mealId": { "type": "string" } } } }, { "name": "changeId", "in": "path", "description": "Change Id", "required": true, "schema": { "properties": { "changeId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } }, "/consumer/direct/trade/{tradeId}": { "get": { "summary": "Get Direct Trade Payment Method", "description": "Allows an user to see a direct trade payment method", "tags": ["Trades"], "security": [{ "basicAuth": [] }], "parameters": [ { "name": "tradeId", "in": "path", "description": "Ticket Id", "required": true, "schema": { "properties": { "tradeId": { "type": "string" } } } } ], "responses": { "500": { "description": "ERROR", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Register without body": { "value": { "msg": "Missing Arguments!" } } } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Unauthorized Request": { "value": { "Error": "Unauthorized Request" } } } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "properties": { "msg": { "type": "string" } } }, "examples": { "Success": { "value": { "Error": "Success" } } } } } } } } } }, "components": { "securitySchemes": { "basicAuth": { "type": "http", "scheme": "bearer" } }, "schemas": { "Notification": { "type": "object", "properties": { "notiid": { "type": "string" }, "date": { "type": "string" }, "receiverid": { "type": "string" }, "senderid": { "type": "string" }, "description": { "type": "string" }, "isseen": { "type": "boolean" }, "istradeproposal": { "type": "boolean" } } }, "Meal": { "type": "object", "properties": { "name": { "type": "string" }, "preparationTime": { "type": "number" }, "description": { "type": "string" }, "canTakeAway": { "type": "boolean" }, "price": { "type": "number" }, "allowedChanges": { "type": "array", "items": { "type": "object", "$ref": "#/components/schemas/AllowedChanges" } } } }, "AllowedChanges": { "type": "object", "properties": { "ingname": { "type": "string" }, "ingdosage": { "type": "string" }, "isremoveonly": { "type": "boolean" }, "canbeincremented": { "type": "boolean" }, "canbedecremented": { "type": "boolean" }, "incrementlimit ": { "type": "number" }, "decrementlimit": { "type": "number" } } }, "Profile": { "type": "object", "properties": { "preferredCampus": { "type": "string" }, "preferredBar": { "type": "string" }, "imgUrl": { "type": "string" } } }, "Order": { "type": "object", "items": { "properties": { "ticketid": { "type": "string" }, "nencomenda": { "type": "number" }, "ticketamount": { "type": "number" }, "total": { "type": "number" }, "name": { "type": "string" } } } } } } }