feat: páginas de configuración (departamentos, equipo, SLA)
This commit is contained in:
1 parent
7d72970f8a
commit
3a1fee74e7
6 files changed
+920
No files matched your search
@@ -250,3 +250,87 @@ export interface DashboardStats {
|
||||
criticalTickets: number;
|
||||
dailyCounts: { date: string; count: number }[];
|
||||
}
|
||||
|
||||
// ==================== Departamentos ====================
|
||||
export async function createGroup(data: { name: string; description?: string }) {
|
||||
return fetchApi<Group>("/api/helpdesk/groups", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateGroup(
|
||||
id: number,
|
||||
data: { name?: string; description?: string; isActive?: boolean }
|
||||
) {
|
||||
return fetchApi<void>(`/api/helpdesk/groups/${id}`, {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteGroup(id: number) {
|
||||
return fetchApi<void>(`/api/helpdesk/groups/${id}`, { method: "DELETE" });
|
||||
}
|
||||
|
||||
// ==================== Equipo ====================
|
||||
export interface TeamMember extends HelpDeskUser {
|
||||
role: string;
|
||||
departmentId?: number;
|
||||
departmentName?: string;
|
||||
isActive?: boolean;
|
||||
}
|
||||
|
||||
export async function getTeam() {
|
||||
return fetchApi<TeamMember[]>("/api/helpdesk/users");
|
||||
}
|
||||
|
||||
export async function addMember(data: {
|
||||
idUsuario: string;
|
||||
role?: string;
|
||||
departmentId?: number;
|
||||
}) {
|
||||
return fetchApi<TeamMember>("/api/helpdesk/users", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateMember(
|
||||
idUsuario: string,
|
||||
data: { role?: string; departmentId?: number; isActive?: boolean }
|
||||
) {
|
||||
return fetchApi<TeamMember>(`/api/helpdesk/users/${encodeURIComponent(idUsuario)}`, {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
}
|
||||
|
||||
// ==================== SLA ====================
|
||||
export async function createSla(data: {
|
||||
name: string;
|
||||
description?: string;
|
||||
responseTimeHours?: number;
|
||||
resolutionTimeHours?: number;
|
||||
}) {
|
||||
return fetchApi<SLAPolicy>("/api/helpdesk/sla", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateSla(
|
||||
id: number,
|
||||
data: {
|
||||
name?: string;
|
||||
description?: string;
|
||||
responseTimeHours?: number;
|
||||
resolutionTimeHours?: number;
|
||||
isActive?: boolean;
|
||||
}
|
||||
) {
|
||||
return fetchApi<void>(`/api/helpdesk/sla/${id}`, {
|
||||
method: "PUT",
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user