import { apiClient } from './client'; import type { PlatformRole } from '@horux/shared'; export interface PlatformStaffUser { id: string; email: string; nombre: string; active: boolean; tenant: { id: string; nombre: string; rfc: string } | null; roles: PlatformRole[]; } export interface CandidateUser { id: string; email: string; nombre: string; active: boolean; tenant: { id: string; nombre: string; rfc: string } | null; } export async function listStaff(): Promise { const response = await apiClient.get('/platform-staff'); return response.data; } export async function searchUsers(q: string): Promise { const response = await apiClient.get('/platform-staff/search', { params: { q } }); return response.data; } export async function grantRole(userId: string, role: PlatformRole): Promise { await apiClient.post('/platform-staff/grant', { userId, role }); } export async function revokeRole(userId: string, role: PlatformRole): Promise { await apiClient.post('/platform-staff/revoke', { userId, role }); }