package eu.gaudian.translator.model

import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import kotlinx.parcelize.RawValue
import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement
import kotlin.time.Clock
import kotlin.time.ExperimentalTime

@Serializable
@Parcelize
data class DictionaryEntry @OptIn(ExperimentalTime::class) constructor(
    val id: Int,
    val word: String,
    val definition: List<EntryPart>, //list of Word class, declination, origin, etc.
    var languageCode: Int,
    var languageName: String,
    @Contextual val createdAt: kotlin.time.Instant? = Clock.System.now()) :
    Parcelable

@Serializable
@Parcelize
data class EntryPart(
    val title: String, //e.g. Word class
    val content: @RawValue JsonElement, //e.g. Noun, Verb, etc.
) : Parcelable