package com.fabledsword.minstrel.events

import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonObject

/**
 * Parsed event from the server's SSE stream. Mirrors
 * `flutter_client/lib/shared/live_events_provider.dart`'s `LiveEvent`.
 *
 * - [kind] is the SSE `event:` field (e.g. "track.liked", "playlist.deleted").
 * - [userId] is the actor whose user-scoped state changed (empty for
 *   broadcast events like scan.* that aren't user-bound).
 * - [data] is the raw event payload; consumers deserialize into the
 *   typed shape they expect for the kind they handle.
 */
@Serializable
data class LiveEvent(
    val kind: String,
    val userId: String,
    val data: JsonObject,
)
