import api, { ApiResponse } from './api'; // Types export interface AgentType { id: string; name: string; description: string | null; icon: string | null; isActive: boolean; sortOrder: number; createdAt: string; updatedAt: string; _count?: { agents: number; }; } export interface CreateAgentTypeDto { name: string; description?: string; icon?: string; isActive?: boolean; sortOrder?: number; } export interface UpdateAgentTypeDto { name?: string; description?: string; icon?: string; isActive?: boolean; sortOrder?: number; } // Agent Types Service class AgentTypesService { private basePath = '/agent-types'; async getAll(includeInactive = false): Promise { const url = includeInactive ? `${this.basePath}?includeInactive=true` : this.basePath; const response = await api.get>(url); return response.data.data; } async getById(id: string): Promise { const response = await api.get>(`${this.basePath}/${id}`); return response.data.data; } async create(data: CreateAgentTypeDto): Promise { const response = await api.post>(this.basePath, data); return response.data.data; } async update(id: string, data: UpdateAgentTypeDto): Promise { const response = await api.patch>(`${this.basePath}/${id}`, data); return response.data.data; } async delete(id: string): Promise { await api.delete(`${this.basePath}/${id}`); } } export const agentTypesService = new AgentTypesService();