Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ytabeloved/ordervista/llms.txt

Use this file to discover all available pages before exploring further.

The Customer is the self-service role in Ordervista, designed for end-users who interact with the restaurant through the online storefront. Accounts with id_rol: 3 are created through public self-registration — no administrator action is required to onboard a new customer. Once registered and logged in, a customer can browse the full active menu, build a cart, choose between delivery and takeaway order types, provide a delivery address where applicable, confirm their order, and return at any time to check the current status of past orders. Customers have no visibility into administrative, catalog-management, or operational screens.

Registration

Customers create their own accounts without any administrator involvement. The registration endpoint is publicly accessible — no JWT is required.
POST /api/auth/register
The backend assigns id_rol: 3 automatically to every account created through this endpoint. After registration, the customer can log in via POST /api/auth/login to receive a JWT and begin placing orders.

Accessible Frontend Routes

After logging in, a Customer is directed to the customer-facing storefront. The following frontend routes are available to this role.
RoutePagePurpose
/menuMenuBrowse all active products organised by category.
/cartCartReview selected items, adjust quantities, and proceed to checkout.
/addressesAddressesManage saved delivery addresses for use in delivery orders.
/ordersOrdersView personal order history and track current order statuses.

API Endpoints Accessible

All routes below require a valid JWT (Authorization: Bearer <token>). Routes marked authorizeRoles(3) are exclusive to Customers; routes marked verifyToken only are available to any authenticated user regardless of role.

Orders — authorizeRoles(3)

MethodEndpointAction
GET/api/ordersList all orders placed by the logged-in customer.
GET/api/orders/:idGet the full detail of one of the customer’s orders.
POST/api/ordersPlace a new online order.
MethodEndpointAction
GET/api/menuRetrieve all active products available on the menu.

Addresses — verifyToken only (any authenticated user)

MethodEndpointAction
GET/api/addressesList all saved addresses.
POST/api/addressesSave a new delivery address.
PUT/api/addresses/:idUpdate an existing saved address.
DELETE/api/addresses/:idRemove a saved address.

Workflow

1

Register or log in

New customers navigate to /register and submit their details. The backend creates the account with id_rol: 3 automatically. Returning customers go to /login. Either path results in a JWT being stored in localStorage that authorises all subsequent requests.
2

Browse the menu

Navigate to /menu to see the full active product catalog returned by GET /api/menu. Products are organised by category so customers can quickly find what they are looking for.
3

Add items to the cart

Select products and adjust quantities. The cart is managed client-side until the customer is ready to check out.
4

Select order type and address

Before confirming, the customer chooses an order type (id_tipo_pedido) — Delivery, Retiro, or Consumo Local. For Delivery orders, the customer selects a saved address from /addresses or adds a new one via POST /api/addresses.
5

Confirm the order

Submit the cart as a new order via POST /api/orders. The request body includes the selected products, quantities, and the chosen id_tipo_pedido. The backend creates the order with an initial status of Pending (status ID 1).
6

Track order status in order history

Navigate to /orders to see a list of all past and current orders returned by GET /api/orders. Selecting an order calls GET /api/orders/:id to show the full detail, including the current status, items ordered, and totals.

Order Types

Every order carries an id_tipo_pedido field that references the TIPOS_PEDIDO table. Customers select the appropriate type at checkout.
Type IDNameDescription
1DeliveryOrder is dispatched to a customer-provided address.
2RetiroCustomer picks up the order at the restaurant.
3Consumo LocalOrder is prepared for consumption inside the restaurant.
Delivery orders (id_tipo_pedido: 1) require a valid saved address. Customers can manage their saved addresses at any time from the /addresses page before or during checkout.

Build docs developers (and LLMs) love