feat: historial de correos en ticket + fechas fijas a America/Santiago

This commit is contained in:
Nurfog committed 2026-09-25 10:11:49 -03:00
1 parent eaa96fbc24
commit 38e21d20dd
6 files changed
+132 -7

No files matched your search

+29
View File
@@ -129,6 +129,35 @@ export async function addComment(
});
}
// ==================== Historial de correos del ticket ====================
// Integración email <-> ticket: enviados desde soporte (mail.log) +
// respuestas recibidas (helpdesk.email_inbound). Visible para quien
// puede ver el ticket (equipo + solicitante).
export interface TicketSentEmail {
id: number;
template: string;
recipient: string;
subject: string;
status: string;
error?: string;
createdAt: string;
}
export interface TicketReceivedEmail {
authorId?: string;
authorEmail: string;
subject: string;
status: string;
error?: string;
createdAt: string;
}
export async function getTicketEmails(ticketId: number) {
return fetchApi<{ sent: TicketSentEmail[]; received: TicketReceivedEmail[] }>(
`/api/helpdesk/ticket/${ticketId}/emails`
);
}
// ==================== Knowledge Base ====================
export async function getKBArticles() {
return fetchApi<KBArticle[]>("/api/helpdesk/kb/published");