package com.fabledsword.minstrel.models

import kotlinx.serialization.Serializable

/**
 * The caller's identity as returned by `POST /api/auth/login`. Narrow
 * field set — no password hash, no api token, no Subsonic password —
 * matches the server's `UserView` envelope.
 *
 * `@Serializable` so AuthStore can persist the current user across
 * cold restarts via the JSON-encoded `userJson` column on
 * `AuthSessionEntity`.
 */
@Serializable
data class UserRef(
    val id: String,
    val username: String,
    val isAdmin: Boolean = false,
    /**
     * Account-level diagnostics opt-in (M9). NOT present in the login
     * response (that's the narrow UserView) — populated by the /api/me
     * refresh in AuthController so a remote admin flip reaches the
     * device. Default false until the first refresh.
     */
    val debugModeEnabled: Boolean = false,
)
