All endpoints require session authentication. Check for
usuario in req.session.Beverage Permits
Endpoints for managing alcoholic beverage sales permits (/venta_de_bebidas).
GET /venta_de_bebidas
List all beverage permits. Authentication Required: Active session Response: Renders view with all permits frompermisos_bebidas table
POST /venta_de_bebidas/get
Get a single permit by ID. Request BodyPermit ID
Permit object with all fields
Session user information
POST /venta_de_bebidas/search
Search permits with filters. Request BodyFilter by status: “Todos”, “Emitido”, or “No Emitido”
Search query (matches code, name, document, phone, sector)
HTML template with filtered and highlighted results
POST /venta_de_bebidas/add
Create a new beverage permit. Authentication Required: Active session Content-Type:multipart/form-data (supports file upload)
Request Body
Start date (YYYY-MM-DD)
Expiration date (YYYY-MM-DD)
Permitted hours
Applicant first name
Applicant last name
ID document number
Phone number
Residence/address
Permitted sector/area
Payment receipt upload (optional)
Current date for validation (YYYY-MM-DD)
Success message: “¡Se ha registrado correctamente el permiso!”
Generated permit code (format: YYYY-NNN)
POST /venta_de_bebidas/edit
Update an existing permit. Request Body: Same as/add plus:
Permit ID to edit
Whether payment receipt is included (“true” or “false”)
“¡Se ha editado correctamente el permiso!”
POST /venta_de_bebidas/aprobate
Approve a permit (upload authorized permit file). Authentication Required: Active session Content-Type:multipart/form-data
Request Body
Permit ID to approve
Authorized permit document
“¡Se ha aprobado correctamente el permiso!”
POST /venta_de_bebidas/cancel
Cancel a permit with observation. Request BodyPermit ID to cancel
Reason for cancellation
“¡Se ha cancelado la emisión del permiso correctamente!”
DELETE /venta_de_bebidas
Delete a permit (admin/developer only). Authentication Required: Administrador or Desarrollador role Request BodyPermit ID to delete
Success or error message
200: Permit deleted successfully404: Permit not found409: Cannot delete (already approved or approved permits exist after this one)500: Server error
GET /venta_de_bebidas/permiso/:permiso
Generate PDF permit document. Authentication Required: Active session URL ParametersPermit identifier (format:
bebidas-alcoholicas_YYYY-NNN)GET /venta_de_bebidas/reporte
Generate complete report of all beverage permits. Response: PDF report with statistics and permit listingsAdvertising Permits
Endpoints for advertising and propaganda permits (/publicidad_y_propaganda).
All endpoints follow the same structure as beverage permits with additional fields:
Additional Fields for Add/Edit:
Flyers included
Posters included
Banners included
Shelf talkers included
Stands included
Stickers included
Flag banners included
Other types included
Description of other advertising types
Additional comments
Endpoints
GET /publicidad_y_propaganda- List allPOST /publicidad_y_propaganda/get- Get by IDPOST /publicidad_y_propaganda/search- SearchPOST /publicidad_y_propaganda/add- CreatePOST /publicidad_y_propaganda/edit- UpdatePOST /publicidad_y_propaganda/aprobate- ApprovePOST /publicidad_y_propaganda/cancel- CancelDELETE /publicidad_y_propaganda- Delete (admin only)GET /publicidad_y_propaganda/permiso/publicidad-y-propaganda_YYYY-NNN- Generate PDFGET /publicidad_y_propaganda/reporte- Generate report
Special Events Permits
Endpoints for special events permits (/eventos_especiales).
All endpoints follow the same structure as beverage permits with additional fields:
Additional Fields for Add/Edit:
Event name
Event type: “Deportivo”, “Cultural”, “Benefico”, “Educativo”, “Religioso”, or custom
Food service included
Beverage service included
Confectionery service included
Various items service included
Ice cream service included
Other services description
Endpoints
GET /eventos_especiales- List allPOST /eventos_especiales/get- Get by IDPOST /eventos_especiales/search- SearchPOST /eventos_especiales/add- CreatePOST /eventos_especiales/edit- UpdatePOST /eventos_especiales/aprobate- ApprovePOST /eventos_especiales/cancel- CancelDELETE /eventos_especiales- Delete (admin only)GET /eventos_especiales/permiso/eventos-especiales_YYYY-NNN- Generate PDFGET /eventos_especiales/reporte- Generate report