- Create an account.
- Fetch all products and services information with their prices.
- Add a product or service to the cart.
- Remove a product or service from the cart.
- Clear the cart.
- View total bill (should include price, quantity, and tax on each item as well as total value of selected items)
- Confirm the order
- Method: POST
- Endpoint:
/signup
- Controller:
authController.signup
- Description: Register a new user account.
- Method: POST
- Endpoint:
/login
- Controller:
authController.login
- Description: Log in an existing user.
- Method: GET
- Endpoint:
/
- Controller:
cartController.getCart
- Middleware:
protect
(authentication required) - Description: Get the cart items for the authenticated user.
- Method: POST
- Endpoint:
/:itemId
- Controller:
cartController.addToCart
- Middleware:
protect
(authentication required) - Description: Add a product or service to the cart for the authenticated user.
- Method: DELETE
- Endpoint:
/:itemId
- Controller:
cartController.removeFromCart
- Middleware:
protect
(authentication required) - Description: Remove a product or service from the cart for the authenticated user.
- Method: DELETE
- Endpoint:
/
- Controller:
cartController.clearCart
- Middleware:
protect
(authentication required) - Description: Clear the cart for the authenticated user.
- Method: GET
- Endpoint:
/
- Controller:
catalogController.getAllCatalogItems
- Description: Get all catalog items.
- Method: GET
- Endpoint:
/:catalogId
- Controller:
catalogController.getCatalogItem
- Description: Get a single catalog item by its ID.
- Method: POST
- Endpoint:
/
- Controller:
catalogController.createCatalogItem
- Middleware:
protect
(authentication required),restrictTo('admin')
(only admins allowed) - Description: Create a new catalog item. This route is only accessible to admin users.
- Method: PATCH
- Endpoint:
/:catalogId
- Controller:
catalogController.updateCatalogItem
- Middleware:
protect
(authentication required),restrictTo('admin')
(only admins allowed) - Description: Update a catalog item by its ID. This route is only accessible to admin users.
- Method: DELETE
- Endpoint:
/:catalogId
- Controller:
catalogController.deleteCatalogItem
- Middleware:
protect
(authentication required),restrictTo('admin')
(only admins allowed) - Description: Delete a catalog item by its ID. This route is only accessible to admin users.
- Method: POST
- Endpoint:
/
- Controller:
orderController.createOrder
- Middleware:
protect
(authentication required) - Description: Create a new order.
- Method: GET
- Endpoint:
/
- Controller:
orderController.getAllOrders
- Middleware:
protect
(authentication required) - Description: Get all orders for the authenticated user. If the user is an admin, all orders will be fetched.
- Method: GET
- Endpoint:
/:orderId
- Controller:
orderController.getOrder
- Middleware:
protect
(authentication required) - Description: Get details of a specific order by its ID.
- Method: PATCH
- Endpoint:
/:orderId/cancel
- Controller:
orderController.cancelOrder
- Middleware:
protect
(authentication required) - Description: Cancel an order by its ID.
- Method: GET
- Endpoint:
/
- Controller:
userController.getAllUsers
- Description: Get all users. (This route might require admin access control depending on the implementation)
- Method: GET
- Endpoint:
/:id
- Controller:
userController.getUser
- Description: Get a single user by their ID.
- Method: PATCH
- Endpoint:
/:id
- Controller:
userController.updateUser
- Middleware:
protect
(authentication required),restrictTo('admin')
(only admins allowed) - Description: Update a user by their ID. This route is only accessible to admin users.
- Method: DELETE
- Endpoint:
/:id
- Controller:
userController.deleteUser
- Middleware:
protect
(authentication required),restrictTo('admin')
(only admins allowed) - Description: Delete a user by their ID. This route is only accessible to admin users.