/**
 * Interfaces and enums for user-related types
 * File: /home/henry/code/Volleyball/frontend/src/components/interfaces/users.tsx
 */

export enum UserRole {
    Admin = 'admin',
    Coach = 'coach',
    Player = 'player',
}


/** Primary user model returned from the API */
export interface User {
    UUID: string
    Username: string
    Email: string
    FirstName?: string
    LastName?: string
    AvatarUrl?: string
    Roles: UserRole[]
    IsActive: boolean
    Phone?: string
    TeamId?: string[]
    CreatedAt?: string // ISO date
    UpdatedAt?: string // ISO date
    LastLogin?: string // ISO date
}

/** Data required to create a new user */
export interface CreateUserDTO {
    username: string
    email: string
    password: string
    firstName?: string
    lastName?: string
    roles?: UserRole[]
}

/** Data for partial updates to a user */
export interface UpdateUserDTO {
    username?: string
    email?: string
    password?: string
    firstName?: string | null
    lastName?: string | null
    avatarUrl?: string | null
    roles?: UserRole[]
    isActive?: boolean
    teamId?: string | null
    metadata?: Record<string, unknown> | null
}

/** Simple auth state slice for frontend state management */
export interface AuthState {
    currentUser?: User | null
    token?: string | null
    isLoading: boolean
    error?: string | null
}