package com.gh.gamecenter.feature.entity

import com.google.gson.annotations.SerializedName

data class VipEntity(
    @SerializedName("vip_status")
    private val _vipStatus: Boolean? = null,
    @SerializedName("is_new_user")
    private val _isNewUser: Boolean? = null,
    @SerializedName("is_try_vip")
    private val _isTryVip: Boolean? = null,
    @SerializedName("vip_expire_time")
    private val _vipExpireTime: Long? = null,
    @SerializedName("duration_vip_expire_time")
    private val _durationVipExpiredTime: Long? = null,
    @SerializedName("duration_expire_time")
    private val _durationExpiredTime: Long? = null, // 时长会员剩余总时长 单位：分
    @SerializedName("is_vip_refund_user")
    private val _isVipRefundUser: Boolean? = null,
    @SerializedName("is_duration_refund_user")
    private val _isDurationRefundUser: Boolean? = null,
    @SerializedName("timestamp")
    private val _timestamp: Long? = null
) {

    val vipStatus: Boolean
        get() = _vipStatus ?: false

    val isNewUser: Boolean
        get() = _isNewUser ?: false

    val isTryVip: Boolean
        get() = _isTryVip ?: false

    val durationVipExpiredTime: Long
        get() = _durationVipExpiredTime ?: 0

    val vipExpireTime: Long
        get() = _vipExpireTime ?: 0

    val isVipRefundUser: Boolean
        get() = _isVipRefundUser ?: false

    val isDurationRefundUser: Boolean
        get() = _isDurationRefundUser ?: false

    val durationExpiredTime: Long
        get() = _durationExpiredTime ?: 0L

    val timestamp: Long
        get() = _timestamp ?: 0L

    val isMonthVip: Boolean
        get() = vipStatus && vipExpireTime > 0 && !isTryVip

    val isDurationVip: Boolean
        get() = vipStatus && durationVipExpiredTime != 0L
}