Every restaurant in GastroMóvil is owned by a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lffiesco-svg/gastromovil/llms.txt
Use this file to discover all available pages before exploring further.
Usuario with rol='restaurante'. A matching Restaurante record is created automatically the moment that user is registered. From there, the owner uses a JavaScript-powered panel at /panel-restaurante/ to build their menu by creating categories, adding products to each category, and toggling product availability — all without leaving the page. Images for both the restaurant banner and individual products are stored on Cloudinary.
Data Models
Restaurante
The top-level model that represents a single food business on the platform:
Categoria
A menu section that belongs to one restaurant. Products are always attached to a category, never directly to a restaurant:
Producto
An individual menu item nested inside a category:
The
disponible field is a simple toggle. Only products where disponible=True appear in the public restaurant page and are served to the AI chatbot’s product context.Image Validation
Restaurant banner images are validated by two custom validators before being sent to Cloudinary:Restaurant Panel API
The panel at/panel-restaurante/ is a single-page experience that talks to a set of session-authenticated REST API endpoints. All endpoints require the user to be logged in (IsAuthenticated) and implicitly scope results to the requesting user’s restaurant.
Restaurant Info
| Method | Endpoint | Description |
|---|---|---|
GET | /api/restaurantes/<pk>/ | Fetch restaurant details (id, nombre, direccion, telefono, activo) |
PUT | /api/restaurantes/<pk>/editar/ | Update restaurant info (supports partial updates) |
Products
| Method | Endpoint | Description |
|---|---|---|
GET | /api/productos/ | List all products belonging to the owner’s restaurant, including category name, availability, and Cloudinary image URL |
POST | /api/productos/crear/ | Create a new product; accepts multipart/form-data for image upload |
PUT | /api/productos/<pk>/editar/ | Edit a product; optionally replace its image |
DELETE | /api/productos/<pk>/eliminar/ | Delete a product |
Categories
| Method | Endpoint | Description |
|---|---|---|
GET | /api/categorias/ | List all categories belonging to the owner’s restaurant |
POST | /api/categorias/crear/ | Create a new category |
PUT | /api/categorias/<pk>/editar/ | Rename a category |
DELETE | /api/categorias/<pk>/eliminar/ | Delete a category (cascades to its products) |
All panel API endpoints enforce ownership — for example,
producto_eliminar_api uses get_object_or_404(Producto, pk=pk, categoria__restaurante__propietario=request.user) to ensure a restaurant owner can only modify their own products.Public Restaurant Pages
Restaurant Listing
GET /restaurantes/ renders a page that displays all restaurants where activo=True. Inactive restaurants are hidden from public view but still accessible to the owner through the panel.
Restaurant Detail Page
GET /restaurantes/restaurante/<pk>/ shows the full menu for a single restaurant. The view groups products by their category and passes the full list of ratings to calculate an average score:
Rating and Review Rules
Rating and Review Rules
- A customer can only leave one rating per delivered order (
OneToOneFieldbetweenCalificacionandPedido). - The
puede_calificarflag is set toTrueon the detail page only if the logged-in user has at least oneentregadoorder from that restaurant that has not yet been rated. - Comments are checked against a curated list of Spanish profanity words using the
better-profanitylibrary. Flagged comments are rejected with an error message and the rating is not saved.
How Menus Are Structured
restaurante_id of a product is always resolved through the chain producto → categoria → restaurante.