package com.gh.gamecenter.feature.entity

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

@Parcelize
data class WelfareInfo(
    @SerializedName("recharge_discount")
    private val _rechargeDiscount: String? = null,
    @SerializedName("single_price_style")
    private val _singlePriceStyle: String? = null,
    @SerializedName("double_price_style")
    private val _doublePriceStyle: String? = null,
    @SerializedName("label_text")
    private val _labelText: String? = null,
    @SerializedName("recharge_original_price")
    private val _rechargeOriginalPrice: Float? = null,
    @SerializedName("recharge_current_price")
    private val _rechargeCurrentPrice: Float? = null,
    @SerializedName("additional_text")
    private val _additionalText: String? = null
) : Parcelable {

    val rechargeDiscount: String
        get() = _rechargeDiscount ?: ""

    val singlePriceStyle: String
        get() = _singlePriceStyle ?: ""

    val doublePriceStyle: String
        get() = _doublePriceStyle ?: ""

    val labelText: String
        get() = _labelText ?: ""

    val rechargeOriginalPrice: Int
        get() = _rechargeOriginalPrice?.toInt() ?: 0

    val rechargeCurrentPrice: String
        get() = DecimalFormat("0.##").format(_rechargeCurrentPrice ?: 0F)


    val additionalText: String
        get() = _additionalText ?: ""
}