package com.radiola.data.remote.dto

import kotlinx.serialization.Serializable

/** DTO ответа чартов — список позиций. */
@Serializable
data class ChartsResponseDto(
    val items: List<ChartEntryDto> = emptyList()
)

/** DTO списка доступных жанров для фильтра. */
@Serializable
data class GenresResponseDto(
    val genres: List<String> = emptyList()
)

/** Одна позиция в чарте. */
@Serializable
data class ChartEntryDto(
    val rank: Int,
    val trackId: String,
    val artist: String,
    val song: String,
    val coverUrl: String? = null,
    val genre: String? = null,
    val styles: List<String> = emptyList(),
    val label: String? = null,
    val year: Int? = null,
    val plays: Int = 0,
    val stationsCount: Int = 0,
    val likes: Int = 0,
    val prevRank: Int? = null,
    /** Направление: up | down | new | same */
    val trend: String = "same"
)

/** Подробная статистика трека. */
@Serializable
data class TrackStatsDto(
    val trackId: String,
    val artist: String,
    val song: String,
    val album: String? = null,
    val coverUrl: String? = null,
    val genre: String? = null,
    val styles: List<String> = emptyList(),
    val label: String? = null,
    val year: Int? = null,
    val releaseDate: String? = null,
    val firstSeen: String? = null,
    val totalPlays: Int = 0,
    val totalLikes: Int = 0,
    val isLiked: Boolean = false,
    val currentRank: Int? = null,
    val peakRank: Int? = null,
    val stations: List<StationPlaysDto> = emptyList(),
    val playsTimeline: List<PointDto> = emptyList(),
    val likesTimeline: List<PointDto> = emptyList()
)

/** Проигрывания на конкретной станции. */
@Serializable
data class StationPlaysDto(
    val stationId: Int,
    val name: String,
    val plays: Int
)

/** Одна точка тайм-лайна. */
@Serializable
data class PointDto(
    val date: String,
    val value: Int
)
