Every request body sent to the Restaurant Equis API is validated by Pydantic v2 before it reaches the database layer, and every JSON response is serialized through these same schemas. The SQLAlchemy ORM models map one-to-one with the PostgreSQL tables defined in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/teofilobetancourt/Restaurant-Equis/llms.txt
Use this file to discover all available pages before exploring further.
public schema (for restaurant operations) and the Inventario schema (for stock and supplier management). Familiarity with these shapes is essential whether you are building a new frontend widget, scripting bulk imports, or writing integration tests.
Enums
All enum values are stored as plain strings in PostgreSQLENUM columns. Pydantic coerces input strings to the matching member at validation time, so casing must match exactly.
CategoriaPlatoEnum.acompanante is stored as the Unicode string "acompañante" (with ñ) in PostgreSQL. Ensure your HTTP client sends the string encoded as UTF-8.Table Models
public.mesa — Table Management
MesaIn and MesaOut represent a physical dining table in the restaurant. Use these schemas when creating or reading table records via /api/mesas.
MesaIn — Create/Update Table
MesaIn — Create/Update Table
disponible when omitted. One of disponible, ocupada, reservada, or fuera_de_servicio."Terraza", "Salón principal"). Optional; stored as up to 100 characters.MesaOut — Table Response
MesaOut — Table Response
Order Models
PedidoIn — Create Order
PedidoIn — Create Order
POST /api/pedidos.mesa, pickup, or delivery.recibido when omitted.tipo_pedido is mesa; omit for pickup and delivery orders.cliente table.cedula_cliente exists yet.cedula_cliente exists yet.tipo_pedido is delivery.PedidoOut — Order Response
PedidoOut — Order Response
GET /api/pedidos, GET /api/pedidos/{id}, and on success from POST /api/pedidos.mesa, pickup, or delivery.null for pickup and delivery orders.null for dine-in and pickup orders.null if the customer record cannot be resolved.PedidoUpdateEstatus — Update Order Status
PedidoUpdateEstatus — Update Order Status
PUT /api/pedidos/{id}.recibido, preparando, listo, or entregado.FacturaIn — Create Invoice
FacturaIn — Create Invoice
POST /api/facturas.public.pedido.num_ticket). One invoice per order — this value must be unique.0 when omitted.subtotal + impuesto).pendiente when omitted."efectivo", "tarjeta"). Optional; stored as up to 30 characters.FacturaOut — Invoice Response
FacturaOut — Invoice Response
Factura is generated for a completed order. A Factura has a one-to-one relationship with a Pedido via num_ticket.public.pedido.num_ticket). Unique — one invoice per order.0 if not specified at creation time.subtotal + impuesto).pendiente, pagado, or anulado. Defaults to pendiente."efectivo", "tarjeta"). null if not recorded.Product Models
PlatoIn — Create/Update Dish
PlatoIn — Create/Update Dish
POST /api/productos.NUMERIC(8,2) in PostgreSQL).entrada, plato_principal, postre, bebida, or acompañante.PlatoOut — Dish Response
PlatoOut — Dish Response
Customer Model
ClienteIn and ClienteOut share the same fields. The only distinction is that ClienteOut enables from_attributes=True for ORM serialization.
ClienteIn / ClienteOut — Customer
ClienteIn / ClienteOut — Customer
public.cliente. Stored as up to 20 characters.Inventory Models
InsumoIn — Create Inventory Item
InsumoIn — Create Inventory Item
POST /api/inventario."kg", "litros", "unidades"). Stored as up to 20 characters.0. Maps to NUMERIC(12,4) in PostgreSQL.0.0.Inventario.Categoria.ID_Categoria. Optional; null if the item is uncategorized.InsumoOut — Inventory Item Response
InsumoOut — Inventory Item Response
GET /api/inventario and POST /api/inventario.null if uncategorized.Supplier Models
ProveedorIn — Create Supplier
ProveedorIn — Create Supplier
POST /api/proveedores.Identificación_RIF (with accent).ProveedorOut — Supplier Response
ProveedorOut — Supplier Response
GET /api/proveedores, POST /api/proveedores, and PUT /api/proveedores/{id}. Extends ProveedorIn with the auto-generated primary key.Report Models
ResumenReporte — Dashboard Summary
ResumenReporte — Dashboard Summary
GET /api/reportes/resumen. Provides a period-over-period snapshot for the management dashboard.entregado status.Database Tables (ORM)
The SQLAlchemy models inmodels.py map to the following PostgreSQL tables. All columns marked PK are auto-incremented unless noted otherwise.
public schema — Restaurant Operations
public.mesa
public.mesa
| Field | Type | Constraints |
|---|---|---|
id_mesa | INTEGER | PK, auto-increment, indexed |
capacidad | INTEGER | NOT NULL |
estado | EstadoMesaEnum | NOT NULL, default disponible |
ubicacion | VARCHAR(100) | nullable |
public.plato
public.plato
| Field | Type | Constraints |
|---|---|---|
id_plato | INTEGER | PK, auto-increment, indexed |
nombre | VARCHAR(100) | NOT NULL |
descripcion | VARCHAR(255) | nullable |
precio | NUMERIC(8,2) | NOT NULL |
categoria | CategoriaPlatoEnum | NOT NULL |
public.cliente
public.cliente
| Field | Type | Constraints |
|---|---|---|
cedula_cliente | VARCHAR(20) | PK (natural key), indexed |
nombre | VARCHAR(100) | NOT NULL |
telefono | VARCHAR(20) | NOT NULL |
email | VARCHAR(100) | nullable |
direccion_habitual | VARCHAR(255) | nullable |
public.pedido
public.pedido
| Field | Type | Constraints |
|---|---|---|
num_ticket | INTEGER | PK, auto-increment, indexed |
tipo_pedido | TipoPedidoEnum | NOT NULL |
estado_orden | EstadoOrdenEnum | NOT NULL, default recibido |
id_mesa | INTEGER | FK → public.mesa.id_mesa, nullable |
cedula_cliente | VARCHAR(20) | FK → public.cliente.cedula_cliente, NOT NULL |
direccion_envio | VARCHAR(255) | nullable |
fecha_creacion | TIMESTAMP | NOT NULL, default utcnow |
public.detalle_pedido
public.detalle_pedido
| Field | Type | Constraints |
|---|---|---|
num_ticket | INTEGER | PK + FK → public.pedido.num_ticket |
id_plato | INTEGER | PK + FK → public.plato.id_plato |
cantidad | INTEGER | NOT NULL |
subtotal | NUMERIC(8,2) | NOT NULL |
detalle_pedido uses a composite primary key of (num_ticket, id_plato). Rows are cascade-deleted when the parent pedido is removed.public.factura
public.factura
| Field | Type | Constraints |
|---|---|---|
num_factura | INTEGER | PK, auto-increment, indexed |
num_ticket | INTEGER | FK → public.pedido.num_ticket, UNIQUE, NOT NULL |
fecha_emision | TIMESTAMP | NOT NULL, default utcnow |
subtotal | NUMERIC(8,2) | NOT NULL |
impuesto | NUMERIC(8,2) | NOT NULL, default 0 |
total | NUMERIC(8,2) | NOT NULL |
estado_pago | EstadoPagoEnum | NOT NULL, default pendiente |
metodo_pago | VARCHAR(30) | nullable |
Inventario schema — Stock Management
Inventario.Categoria
Inventario.Categoria
| Field | Type | Constraints |
|---|---|---|
ID_Categoria | BIGINT | PK, auto-increment |
Nombre_Categoria | VARCHAR(100) | UNIQUE, NOT NULL |
Inventario.Insumos
Inventario.Insumos
| Field | Type | Constraints |
|---|---|---|
ID_Insumos | BIGINT | PK, auto-increment |
Nombre_Insumo | VARCHAR(100) | UNIQUE, NOT NULL |
Unidad_Medida | VARCHAR(20) | NOT NULL |
Stock_Actual | NUMERIC(12,4) | NOT NULL, default 0 |
Stock_Minimo | NUMERIC(12,4) | NOT NULL, default 0 |
Punto_Reorden | NUMERIC(12,4) | NOT NULL, default 0 |
FK_IDCategoria | BIGINT | FK → Inventario.Categoria.ID_Categoria, nullable |
Inventario.Proveedores
Inventario.Proveedores
| Field | Type | Constraints |
|---|---|---|
ID_Proveedor | BIGINT | PK, auto-increment |
Nombre_Empresa | VARCHAR(150) | NOT NULL |
Identificacion_RIF | VARCHAR(30) | UNIQUE, NOT NULL |
Ciudad | VARCHAR(100) | NOT NULL |
Telefono_Empresa | VARCHAR(30) | NOT NULL |
Email_Empresa | VARCHAR(100) | UNIQUE, NOT NULL |
Direccion | VARCHAR(255) | NOT NULL |
Nombre_Encargado | VARCHAR(100) | NOT NULL |