Overview
The permit workflow in the Sistema de Permisos Municipales follows a standardized process from creation to approval or cancellation. This guide covers the complete lifecycle for all three permit types.Workflow stages
Creation
A user creates a new permit request with all required information and supporting documents.
Decision
An authorized user either approves the permit (uploading the authorized document) or cancels it with an observation.
Creating a permit
Required information
All permits require the following base information:Start date of the permit validity period
End date of the permit validity period
Operating schedule or time restrictions
Applicant’s first name
Applicant’s last name
Applicant’s ID document number
Contact phone number
Applicant’s address
Location where the permit applies
Payment receipt document (optional)
Date validation
The system validates that permits are created on the current date:Permit code generation
Each permit receives a unique code:Permit codes are sequential within each year and auto-generated. You cannot manually set the code.
File upload handling
Payment receipts are uploaded using multipart form data:- Bebidas:
src/public/server-files/asuntos_publicos/permisos_municipales/bebidas/ - Publicidad:
src/public/server-files/asuntos_publicos/permisos_municipales/publicidad/ - Eventos:
src/public/server-files/asuntos_publicos/permisos_municipales/eventos/
Reviewing permits
Listing permits
Retrieve all permits for a specific type:Searching and filtering
The search endpoint allows filtering permits:Filter by status: “Todos”, “Emitido”, or “No Emitido”
Search term (searches across codigo, nombre, cedula, sector, etc.)
- Permit code (codigo_permiso)
- Applicant name (requisitor_nombre + requisitor_apellido)
- ID document (requisitor_doc)
- Phone number (requisitor_tlf)
- Authorized sector (sector_permisado)
- Dates (habilitacion, vencimiento)
Viewing permit details
Retrieve a specific permit:Editing permits
To edit a permit:- Date validation still applies (must match today)
- Can update the payment receipt file
- Editor’s name is recorded in the
editorfield - Original creator is preserved in the
creadorfield
Approving permits
Once a permit is approved (emitido=1), it cannot be edited or deleted. Only cancellation is possible.
Cancelling permits
Permits can be cancelled with an observation explaining the reason:Explanation for the cancellation (stored in database)
- The
canceladofield is set to 1 - The observation is stored
- The permit remains in the system for record-keeping
- It appears with a “canceled” status in searches
Real-time notifications
The system uses WebSockets to notify users of permit changes in real time:Generating PDFs
Individual permit PDFs
Generate a PDF for a specific approved permit:- Bebidas:
bebidas-alcoholicas_YYYY-### - Publicidad:
publicidad-y-propaganda_YYYY-### - Eventos:
eventos-especiales_YYYY-###
- Retrieves permit data from database
- Renders EJS template with permit information
- Converts HTML to PDF using html-pdf and phantomjs
- Returns PDF buffer with
Content-Type: application/pdf
Batch reports
Generate comprehensive reports for all permits:- Total registered permits
- Emitted permits (emitido=1, cancelado=0)
- Not emitted permits (emitido=0)
- Cancelled permits (cancelado=1)
- Authorized permits (dat_confirmacion=1)
- Not authorized permits (dat_confirmacion=0)
Report structure example
Report structure example
Deleting permits
Deletion endpoint:- Verifies permit exists
- Confirms it has not been approved
- Checks if any later permits in the same year have been approved
- Deletes the permit file
- Removes the database record
- Recalculates codes for all subsequent permits in the same year
Permit states
Permits can be in one of three visual states:Disaproved
Not yet approved (emitido=0). Can be edited or deleted.
Aproved
Approved (emitido=1, cancelado=0). Cannot be edited. Can only be cancelled.
Canceled
Cancelled (cancelado=1). Preserved for records with observation note.
Best practices
Verify information
Double-check all fields before approving. Approved permits cannot be edited.
Document cancellations
Always provide clear observations when cancelling permits.
Keep receipts
Upload payment receipts whenever available for complete records.
Monitor real-time
Enable WebSocket notifications to stay informed of new permits.
Next steps
Alcoholic beverages
Detailed guide for beverage permits
Advertising
Advertising permit specifics
Special events
Event permit details