import { apiRequest } from './api'; import type { AdministrativeUser } from './api'; export interface AdministrativeUserProfile extends AdministrativeUser { dni: string | null; phone: string | null; jobTitle: string | null; employeeNumber: string | null; } export interface UserProfileInput { username?: string; email?: string | null; dni?: string | null; phone?: string | null; jobTitle?: string | null; employeeNumber?: string | null; firstName?: string; lastName?: string; } export interface CreateUserProfileInput extends UserProfileInput { username: string; email: string; firstName: string; lastName: string; password: string; mustChangePassword: boolean; roleIds: string[]; } export function getUserProfile(id: string) { return apiRequest(`/users/${id}`); } export function createUserProfile(input: CreateUserProfileInput) { return apiRequest('/users', { method: 'POST', body: JSON.stringify(input), }); } export function updateUserProfile(id: string, input: UserProfileInput) { return apiRequest(`/users/${id}`, { method: 'PATCH', body: JSON.stringify(input), }); }