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 artist. Mirrors `flutter_client/lib/cache/db.dart`'s
 * `CachedArtists` Drift table.
 *
 * Column names follow Kotlin idiom (camelCase) rather than Drift's
 * snake_case — the schema is purely internal to the native client; the
 * sync controller exchanges snake_case JSON with the server and our
 * mappers translate at the boundary.
 */
@Entity(tableName = "cached_artists")
data class CachedArtistEntity(
    @PrimaryKey val id: String,
    val name: String,
    val sortName: String,
    val mbid: String? = null,
    val artistThumbPath: String? = null,
    val artistFanartPath: String? = null,
    val fetchedAt: Instant = Clock.System.now(),
)
