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 sedes API manages Don Mamino’s physical bakery locations. Each sede has a name, address, phone number, and contact email. Users and products are assigned to a sede, making it a foundational resource in the API. GET endpoints are publicly accessible; write operations require a valid JWT Bearer token.

GET /api/sedes

Retrieve a list of all sedes. Auth required: No

Response fields

Returns an array of sede objects.
id_sede
number
Unique identifier of the sede.
nombre_sede
string
Name of the location (e.g., "Sede Central", "Sucursal Miraflores").
direccion
string
Physical street address of the sede.
telefono
string
Contact phone number of the sede (up to 15 characters).
email
string
Contact email address for the sede. Must be unique across all sedes.

Example

curl
curl --request GET \
  --url http://localhost:3000/api/sedes

GET /api/sedes/:id

Retrieve a single sede by its ID. Auth required: No

Path parameters

id
number
required
The id_sede of the sede to retrieve.

Response fields

Returns a single sede object with the same fields as the list endpoint above.

Example

curl
curl --request GET \
  --url http://localhost:3000/api/sedes/1

Error responses

StatusDescription
404No sede found with the given ID. Response body: { "message": "Sede no encontrada" }
500Internal server error.

POST /api/sedes

Create a new sede. Auth required: Yes
This endpoint requires a valid JWT token. Include it in the Authorization header as Bearer <token>.

Request body

nombre_sede
string
required
Name of the new location.
direccion
string
required
Physical address of the new location.
telefono
string
required
Contact phone number. Maximum 15 characters.
email
string
required
Contact email address. Must be unique across all sedes.

Response fields

id
number
The auto-generated id_sede of the newly created sede.
mensaje
string
Confirmation message. Returns "Sede creada exitosamente".

Example

curl --request POST \
  --url http://localhost:3000/api/sedes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "nombre_sede": "Sucursal San Isidro",
    "direccion": "Av. Rivera Navarrete 123, San Isidro",
    "telefono": "014567890",
    "email": "[email protected]"
  }'

PUT /api/sedes/:id

Update an existing sede by its ID. Auth required: Yes
This endpoint requires a valid JWT token. Include it in the Authorization header as Bearer <token>.

Path parameters

id
number
required
The id_sede of the sede to update.

Request body

Provide the full updated sede object — all columns are overwritten.
nombre_sede
string
required
Updated name of the location.
direccion
string
required
Updated physical address.
telefono
string
required
Updated contact phone number. Maximum 15 characters.
email
string
required
Updated contact email. Must remain unique across all sedes.

Response fields

mensaje
string
Confirmation message. Returns "Sede actualizada exitosamente".

Example

curl
curl --request PUT \
  --url http://localhost:3000/api/sedes/2 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "nombre_sede": "Sucursal San Isidro",
    "direccion": "Av. Camino Real 456, San Isidro",
    "telefono": "014567891",
    "email": "[email protected]"
  }'

Error responses

StatusDescription
404No sede found with the given ID. Response body: { "message": "Sede no encontrada" }
500Internal server error.

DELETE /api/sedes/:id

Delete a sede by its ID. This action is permanent and will cascade to any associated products and orders. Auth required: Yes
This endpoint requires a valid JWT token. Include it in the Authorization header as Bearer <token>. Deleting a sede will cascade-delete all products and orders linked to it.

Path parameters

id
number
required
The id_sede of the sede to delete.

Response fields

mensaje
string
Confirmation message. Returns "Sede eliminada exitosamente".

Example

curl
curl --request DELETE \
  --url http://localhost:3000/api/sedes/2 \
  --header 'Authorization: Bearer <token>'

Error responses

StatusDescription
404No sede found with the given ID. Response body: { "message": "Sede no encontrada" }
500Internal server error.

Build docs developers (and LLMs) love