@file:Suppress("HardCodedStringLiteral")

package eu.gaudian.translator.model.db

import androidx.room.Entity
import androidx.room.PrimaryKey
import eu.gaudian.translator.model.VocabularyStage
import kotlinx.datetime.LocalDate

/**
 * An entity to store the different types of VocabularyCategory in a single table.
 */
@Entity(tableName = "categories")
data class VocabularyCategoryEntity(
    @PrimaryKey val id: Int,
    val name: String,
    val type: String,

    val filterLanguages: String?,
    val filterStages: String?,

    val dictLangFirst: Int?,
    val dictLangSecond: Int?
)

/**
 * Entity to store the mapping between vocabulary items and categories.
 */
@Entity(tableName = "category_mappings", primaryKeys = ["vocabularyItemId", "categoryId"])
data class CategoryMappingEntity(
    val vocabularyItemId: Int,
    val categoryId: Int
)

/**
 * Entity to store the learning stage for each vocabulary item.
 */
@Entity(tableName = "stage_mappings")
data class StageMappingEntity(
    @PrimaryKey val vocabularyItemId: Int,
    val stage: VocabularyStage
)

/**
 * Entity to store daily learning statistics, replacing dynamic DataStore keys.
 */
@Entity(tableName = "daily_stats")
data class DailyStatEntity(
    @PrimaryKey val date: LocalDate,
    val correctCount: Int
)