package xyz.cottongin.radio247.data.model

import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey

@Entity(
    tableName = "stations",
    foreignKeys = [ForeignKey(
        entity = Playlist::class,
        parentColumns = ["id"],
        childColumns = ["playlistId"],
        onDelete = ForeignKey.SET_NULL
    )],
    indices = [Index("playlistId")]
)
data class Station(
    @PrimaryKey(autoGenerate = true) val id: Long = 0,
    val name: String,
    val url: String,
    val playlistId: Long? = null,
    val sortOrder: Int = 0,
    val starred: Boolean = false,
    val defaultArtworkUrl: String? = null,
    val listenerCount: Int = 0,
    val isHidden: Boolean = false,
    val qualityOverride: String? = null
)
