package com.gh.gamecenter.feature.entity

import android.os.Parcelable
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

@Parcelize
@Entity(tableName = "AcctGameInfo")
data class AcctGameInfo(
    @PrimaryKey(autoGenerate = false)
    val gameId: String,
    val accGamePkgName: String,
    val zoneInfo: ZoneInfo,
    val notifyGameName: String? = null,
    val notifyGameTxtTitle: String? = null,
    val notifyGameSmallLogo: Int? = null,
    val notifyGameLargeLogo: Int? = null,
    val notifyClickParam: String? = null,
) : Parcelable {

    val zoneName: String
        get() = zoneInfo.cnName ?: ""

    @Parcelize
    data class ZoneInfo(
        @SerializedName(value = "_id", alternate = ["id"])
        val id: Int,
        @SerializedName(value = "name", alternate = ["cnName"])
        val cnName: String? = null,
        @SerializedName(value = "en_name", alternate = ["enName"])
        val enName: String? = null
    ) : Parcelable
}