import apiClient from './client';

export interface UserPreferences {
  notifications?: boolean;
  emailUpdates?: boolean;
  darkMode?: boolean;
}

export interface UpdateProfileData {
  name?: string;
  preferences?: UserPreferences;
}

export interface UserProfile {
  id: string;
  email: string;
  name: string;
  role: string;
  locale: string;
  emailVerified: boolean;
  preferences?: UserPreferences;
  families?: string[];
}

export const usersApi = {
  // Update user profile
  updateProfile: async (data: UpdateProfileData): Promise<UserProfile> => {
    const response = await apiClient.patch('/api/v1/auth/profile', data);
    return response.data.data;
  },
};
