TicketsService is part of the shared library (projects/shared/src/lib/tickets.service.ts) and is injectable at the root level — you do not need to add it to any module’s providers array.
The service currently targets
http://127.0.0.1:8000/api/tickets. The production URL (https://back-helpdesk-dmep.onrender.com) is commented out in the source. To switch to production, uncomment the baseUrl line for the Render deployment and comment out the localhost line in tickets.service.ts.Method summary
| Method | HTTP | Description |
|---|---|---|
create | POST /api/tickets/crear | Submit a new ticket |
consultar | POST /api/tickets/consultar | Look up a ticket from the public portal |
dashboard | GET /api/tickets/dashboard | List all tickets for the admin dashboard |
getById | GET /api/tickets/:id | Fetch a single ticket with its history |
dashboardMetricas | GET /api/tickets/dashboard-metricas | Fetch aggregated KPI metrics |
actualizar | POST /api/tickets/:id/actualizar | Update status, priority, area, or response |
asignar | POST /api/tickets/:id/asignar | Assign a ticket to an agent |
transferir | POST /api/tickets/:id/transferir | Transfer a ticket to a new area or agent |
reclasificar | POST /api/tickets/:id/reclasificar | Change priority and category |
pausar | POST /api/tickets/:id/pausar | Pause an active ticket |
reabrir | POST /api/tickets/:id/reabrir | Reopen a closed or paused ticket |
cancelar | POST /api/tickets/:id/cancelar | Cancel a ticket (user or agent) |
archivar | POST /api/tickets/:id/archivar | Archive a resolved ticket |
Source
Methods
create
POST /api/tickets/crear
Parameters
The ticket creation payload. See Ticket model for all fields.
Observable<TicketCreateResponse> — includes the new ticket’s UUID, label, SLA hours, and SLA deadline. See TicketCreateResponse.
Usage example
consultar
POST /api/tickets/consultar
Parameters
Must contain the ticket
label and the email used when the ticket was created. See TicketConsultaPayload.Observable<TicketConsultaResponse> — contains the public ticket view and its history. See TicketConsultaResponse.
dashboard
horasRestantes, slaVencido) and the assigned agent’s name.
HTTP: GET /api/tickets/dashboard
Parameters: None.
Returns: Observable<TicketMDA[]> — array of tickets with admin-level SLA metadata. See TicketMDA.
getById
GET /api/tickets/:id
Parameters
UUID of the ticket to retrieve.
Observable<any> — ticket detail object with a historial array of activity entries.
dashboardMetricas
GET /api/tickets/dashboard-metricas
Parameters: None.
Returns: Observable<any[]> — array of metric objects from the backend.
actualizar
POST /api/tickets/:id/actualizar
Parameters
UUID of the ticket to update.
New status value. See TicketStatus for valid values.
New priority level.
Area to assign the ticket to.
Agent response text to attach to the ticket.
Observable<{ message: string }>
asignar
POST /api/tickets/:id/asignar
Parameters
UUID of the ticket to assign.
UUID of the agent to assign the ticket to.
Reason for the assignment. Recorded in the ticket history.
Observable<{ message: string }>
transferir
POST /api/tickets/:id/transferir
Parameters
UUID of the ticket to transfer.
The destination area.
UUID of the agent in the destination area.
Reason for the transfer. Recorded in the ticket history.
Observable<{ message: string }>
reclasificar
POST /api/tickets/:id/reclasificar
Parameters
UUID of the ticket to reclassify.
New priority level. See TicketPrioridad for valid values.
New category string.
Reason for reclassification. Recorded in the ticket history.
Observable<{ message: string }>
pausar
PAUSADO.
HTTP: POST /api/tickets/:id/pausar
Parameters
UUID of the ticket to pause.
Reason for pausing. Recorded in the ticket history.
Observable<{ message: string }>
reabrir
POST /api/tickets/:id/reabrir
Parameters
UUID of the ticket to reopen.
Reason for reopening. Recorded in the ticket history.
Observable<{ message: string }>
cancelar
rol parameter tells the backend whether the action was taken by the end user or an agent, which may affect business rules and audit logging.
HTTP: POST /api/tickets/:id/cancelar
Parameters
UUID of the ticket to cancel.
Reason for cancellation. Recorded in the ticket history.
The role of the actor performing the cancellation. Pass
'USUARIO' when the end user cancels their own ticket; pass 'AGENTE' when a help desk agent cancels it.Observable<{ message: string }>
archivar
POST /api/tickets/:id/archivar
Parameters
UUID of the ticket to archive.
Reason for archiving. Recorded in the ticket history.
Observable<{ message: string }>