package com.fabledsword.minstrel.models.wire

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
 * One row of `GET /api/me/history`. Mirrors `internal/api/me.go`'s
 * HistoryEvent — a paired (id, played_at, track) tuple. `playedAt` is
 * RFC3339; the UI formats it as a relative timestamp.
 */
@Serializable
data class HistoryEventWire(
    val id: String = "",
    @SerialName("played_at") val playedAt: String = "",
    val track: TrackWire,
)

/**
 * Envelope of `GET /api/me/history`. Not the standard `Page<T>` shape
 * — history is timestamp-keyed so `total` isn't meaningful, only the
 * "more pages exist below" hint.
 */
@Serializable
data class HistoryPageWire(
    val events: List<HistoryEventWire> = emptyList(),
    @SerialName("has_more") val hasMore: Boolean = false,
)
