package com.fabledsword.minstrel.cache.db.entities

import androidx.room.Entity
import androidx.room.PrimaryKey
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant

/**
 * Cache row for one track. Mirrors `flutter_client/lib/cache/db.dart`'s
 * `CachedTracks` Drift table.
 */
@Entity(tableName = "cached_tracks")
data class CachedTrackEntity(
    @PrimaryKey val id: String,
    val albumId: String,
    val artistId: String,
    val title: String,
    val durationMs: Int = 0,
    val trackNumber: Int? = null,
    val discNumber: Int? = null,
    val filePath: String? = null,
    val fileFormat: String? = null,
    val genre: String? = null,
    val fetchedAt: Instant = Clock.System.now(),
)
