The Little Lemon API is an API for the Little Lemon restaurant. Little Lemon's management wants to have an online-based order management system and mobile application. The LittleLemonAPI is the back-end API that allows customers to browse food items, view the item of the day and place orders. Managers are able to update the item of the day and monitor orders and assign deliveries. The delivery crew are able to check the orders assigned to them and update an order once it is delivered.
User groups It contains two user groups (Manager & Delivery crew) and some random users assigned to these groups from the Django admin panel.
Manager
Delivery crew
Users not assigned to a group will be considered customers.
This API makes it possible end-users to perform certain tasks. It has the following functionalities.
-
The admin can assign users to the manager group
-
You can access the manager group with an admin token
-
The admin can add menu items
-
The admin can add categories
-
Managers can log in
-
Managers can update the item of the day
-
Managers can assign users to the delivery crew
-
Managers can assign orders to the delivery crew
-
The delivery crew can access orders assigned to them
-
The delivery crew can update an order as delivered
-
Customers can register
-
Customers can log in using their username and password and get access tokens
-
Customers can browse all categories
-
Customers can browse all the menu items at once
-
Customers can browse menu items by category
-
Customers can paginate menu items
-
Customers can sort menu items by price
-
Customers can add menu items to the cart
-
Customers can access previously added items in the cart
-
Customers can place orders
-
Customers can browse their own orders
-GET method:
-from Anonomous:
401 - unauthorized
-from registered User and Manager:
Retrieves requesting user information
-from Superuser:
Retrieves all Users information
-POST method:
Allows everyone to register an account when supplied with the data:
username
password
email
-POST method:
Returns authorization token for given login:
username
password
-GET method:
displays user information based on token
NOTE a user token is required for all features of the API with the exception of registering and viewing the menu
-GET method:
ACCPETS PARAMS: ?perpage=5-50 | ?page=1 | ?search=title or category | (acsending order)?ordering=price, category | (decending order)?ordering=-price, category
-from Anonomous:
displays menu items rate limit set at two per minute
-from Users and Managers and Superuser:
displays menu items rate limit set at 100 per minute
-POST method:
-from Superusers
Creates menu item when given data:
title
price
-GET method:
From Superusers:
Lists all menu item categories
-POST method:
From Superusers:
Adds a category given:
slug
-GET method:
Displays all details of the given {menuitemId}
-PATCH method:
from Managers and Superusers:
Toggles the featured status of the given {menuitemId}
-DELETE method:
from Superusers:
Deletes the given {menuitemId}
-GET method:
-from Managers and Superusers:
Lists all users in the managers group
-POST method:
-from Managers and Superusers:
Adds a user to the managers group given:
username
-DELETE method:
from Managers and Superusers:
Removes the User associated with {userId} from the managers group
-GET method:
-from Managers and Superusers:
Lists all users in the delivery crew group
-POST method:
-from Managers and Superusers:
Adds a user to the delivery crew group given:
username
-DELETE method:
from Managers and Superusers:
Removes the User associated with {userId} from the delivery crew group
-GET method:
from Users:
Displays all items and quantities currently in user's cart
-POST method:
from Users:
Adds a menu item to the user's cart given:
menuitem (Id)
quantity
-DELETE method:
from Users:
If given a menuitem (Id) removes item from the cart
If no data give removes all items from cart
-GET method:
from Users:
Displays orders owned by user
from Delivery Crew:
Displays orders assigned to delivery crew member
from Managers and Superusers:
Displays all orders
-POST method:
places an order based on items in the user's cart, and empties the cart.
-GET method:
from User:
Shows the order details associated with {orderId} details if user is owner of order.
from Delivery crew, Managers and Superusers:
Shows the order details associated with {orderId}
-PATCH method:
from from Delivery crew, Managers and Superusers:
Toggles the status of the order associated with {orderId}
-PUT method:
from Managers and Superusers:
Assigns a delivery crew to the the order associated with {orderId}
-DELETE method:
from Managers and Superusers:
Deletes the order associated with {orderId}