Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/luisllatas-dev/Proyecto_Pasteleria_DonMamino/llms.txt

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

The Don Mamino API is built on a relational MySQL database that models a multi-location bakery operation. Eight entities cover everything from physical locations and staff to customer orders and per-location inventory. Foreign keys enforce referential integrity throughout, so most records are anchored to a specific sede (branch).
The entire data model is designed around the concept of sedes (physical locations). Nearly every entity—users, products, orders, inventory, and sales reports—carries an id_sede foreign key so data can be scoped and reported per branch.

Entities

Sedes

A sede represents a physical bakery location. All other entities ultimately trace back to a sede.
FieldTypeNotes
id_sedeINTPrimary key, auto-increment
nombre_sedeVARCHAR(255)Display name of the branch
direccionVARCHAR(255)Physical street address
telefonoVARCHAR(15)Contact phone number
emailVARCHAR(100)Contact email address (unique)

Usuarios

Usuarios are the staff accounts that authenticate with the API. Each user is assigned to one sede and carries a role that determines their level of access.
FieldTypeNotes
id_usuarioINTPrimary key, auto-increment
nombre_usuarioVARCHAR(255)Full name
emailVARCHAR(100)Login email (unique)
rolVARCHAR(50)Role string (e.g., administrador, vendedor)
contraseñaVARCHAR(255)bcrypt-hashed password
id_sedeINTForeign key → Sedes

Clientes

Clientes are the bakery’s customers. They are not system users and do not authenticate; their records exist to attach shipping details and order history to a named person.
FieldTypeNotes
id_clienteINTPrimary key, auto-increment
nombre_clienteVARCHAR(255)Full name
emailVARCHAR(100)Contact email (unique)
telefonoVARCHAR(15)Contact phone number
direccion_envioVARCHAR(255)Default shipping address

Productos

Productos represent anything the bakery tracks — both items sold to customers and raw ingredients used internally.
FieldTypeNotes
id_productoINTPrimary key, auto-increment
nombre_productoVARCHAR(255)Product name
descripcionTEXTFull description
precioDECIMAL(10,2)Unit price
stockINTCurrent available quantity (default 0)
imagen_urlVARCHAR(255)URL to the product image
estadoENUMSee values below
tipo_productoENUMSee values below
id_sedeINTForeign key → Sedes
estado values
ValueMeaning
activoProduct is visible and available (default)
inactivoProduct is hidden or discontinued
tipo_producto values
ValueMeaning
vendibleSold directly to customers (default)
insumoInternal ingredient or supply, not sold directly

Pedidos

A pedido is a customer order managed by a staff member at a specific sede.
FieldTypeNotes
id_pedidoINTPrimary key, auto-increment
fecha_pedidoDATETIMEOrder timestamp (default: current time)
estadoENUMSee values below
id_clienteINTForeign key → Clientes
id_usuarioINTForeign key → Usuarios (the staff member who handled it)
id_sedeINTForeign key → Sedes
estado values
ValueMeaning
procesandoOrder received and being confirmed (default)
en preparaciónOrder is being prepared in the kitchen
enviadoOrder has been dispatched for delivery
entregadoOrder has been delivered to the customer

Detalle_Pedido

Each row in Detalle_Pedido is a line item inside a pedido. A single order can reference multiple products.
FieldTypeNotes
id_detalleINTPrimary key, auto-increment
id_pedidoINTForeign key → Pedidos
id_productoINTForeign key → Productos
cantidadINTQuantity of the product ordered
precio_unitarioDECIMAL(10,2)Unit price captured at time of purchase

Inventario

Inventario tracks stock levels for a product at a specific sede and provides a minimum threshold for restocking alerts.
FieldTypeNotes
id_inventarioINTPrimary key, auto-increment
id_productoINTForeign key → Productos
id_sedeINTForeign key → Sedes
cantidad_actualINTCurrent stock count
cantidad_minimaINTMinimum stock before a restock alert is triggered

Reportes_Ventas

Reportes_Ventas stores aggregated sales totals per sede for a given reporting period.
FieldTypeNotes
id_reporteINTPrimary key, auto-increment
fecha_reporteDATETIMEWhen the report was generated (default: current time)
total_ventasDECIMAL(10,2)Total sales amount for the period
id_sedeINTForeign key → Sedes

Relationships

The diagram below describes how the entities connect via foreign keys.
  • Usuarios → Sedes: each user belongs to one sede. If a sede is deleted, the user’s id_sede is set to NULL.
  • Productos → Sedes: each product belongs to one sede. Deleting a sede cascades to its products.
  • Pedidos → Clientes, Usuarios, Sedes: an order links a customer, the staff member who managed it, and the branch that fulfilled it. Deleting a cliente or sede cascades to associated pedidos; deleting the managing usuario sets id_usuario to NULL on existing orders.
  • Detalle_Pedido → Pedidos, Productos: line items belong to one order and reference one product. Deleting either the parent order or the product cascades to its line items.
  • Inventario → Productos, Sedes: stock records track a specific product at a specific sede. Deleting either cascades to the inventory record.
  • Reportes_Ventas → Sedes: sales reports are scoped to a sede. Deleting a sede cascades to its reports.

Build docs developers (and LLMs) love