package com.radiola.data.local.dto

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

@Serializable
data class LocalStationDto(
    @SerialName("id") val id: Int,
    @SerialName("groupId") val groupId: Int,
    @SerialName("name") val name: String,
    @SerialName("bitrate") val bitrate: String? = null,
    @SerialName("site") val site: String? = null,
    @SerialName("stream") val stream: String? = null,
    @SerialName("type") val type: String? = null,
    @SerialName("iconText") val iconText: String? = null,
    @SerialName("textColor") val textColor: String? = null,
    @SerialName("bgColor") val bgColor: String? = null,
    @SerialName("enabled") val enabled: Boolean = true,
    @SerialName("notWorked") val notWorked: Boolean = false,
    @SerialName("isNew") val isNew: Boolean = false,
    @SerialName("qualities") val qualities: List<LocalQualityDto>? = null
)

@Serializable
data class LocalQualityDto(
    @SerialName("bitrate") val bitrate: Int,
    @SerialName("url") val url: String,
    @SerialName("type") val type: String = "aac"
)

@Serializable
data class LocalGroupDto(
    @SerialName("id") val id: Int,
    @SerialName("name") val name: String,
    @SerialName("textColor") val textColor: String? = null,
    @SerialName("bgColor") val bgColor: String? = null,
    @SerialName("info") val info: String? = null,
    @SerialName("stations") val stations: List<Int> = emptyList()
)

@Serializable
data class LocalStationsResponse(
    @SerialName("stations") val stations: List<LocalStationDto> = emptyList(),
    @SerialName("groups") val groups: List<LocalGroupDto> = emptyList(),
    @SerialName("config") val config: LocalConfigDto? = null
)

@Serializable
data class LocalConfigDto(
    @SerialName("stationsBeforeGroups") val stationsBeforeGroups: Boolean = false,
    @SerialName("version") val version: Int = 0
)
