package com.gh.gamecenter.feature.entity

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

@Parcelize
data class AcctRecordEntity(
    @SerializedName("accInfo")
    private val _accInfo: AccInfo? = null
) : Parcelable {

    val accInfo: AccInfo
        get() = _accInfo ?: AccInfo()

    @Parcelize
    data class AccInfo(
        @SerializedName("game")
        private val _game: GameEntity? = null,
        @SerializedName("service_area_id")
        private val _serviceAreaId: Int? = null,
        @SerializedName("service_area")
        private val _serviceArea: String? = null,
        @SerializedName("is_more_service_area")
        private val _isMoreServiceArea: Boolean? = null
    ) : Parcelable {

        val game: GameEntity
            get() = _game ?: GameEntity()

        val serviceAreaId: Int
            get() = _serviceAreaId ?: 0

        val serviceArea: String
            get() = _serviceArea ?: ""

        val isMoreServiceArea: Boolean
            get() = _isMoreServiceArea ?: false
    }
}