package com.khmer9.yuki.remote

import com.gdtlib.lib.adapter.BaseListItem
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class CurrentBettingMobileResponse(
    @Json(name = "code")
    val resultCode: String,

    @Json(name = "message")
    val message: CurrentBettingMobileMessage,

    @Json(name = "data")
    val data: CurrentBettingMobileData?
)

@JsonClass(generateAdapter = true)
data class CurrentBettingMobileMessage(
    @Json(name = "code")
    val code: String,

    @Json(name = "descriptions")
    val description: String
)

@JsonClass(generateAdapter = true)
data class CurrentBettingMobileData(
    @Json(name = "balance")
    val balance: Double,

    @Json(name = "list")
    val list: List<CurrentBettingMobile>?
)

@JsonClass(generateAdapter = true)
data class CurrentBettingMobile(
    @Json(name = "_id")
    var id: String,

    @Json(name = "no")
    val no: Int,

    @Json(name = "total_amount")
    val totalAmount: Double,

    @Json(name = "is_release_result")
    val isReleaseResult: Boolean,

    @Json(name = "total_amount_win")
    val totalAmountWin: Double? = 0.0,

    @Json(name = "total_cast")
    val totalCast: Double? = 0.0,

    @Json(name = "time")
    val time: String,

    @Json(name = "bet_type")
    val betType: List<BetType>?

) : BaseListItem() {
    override fun getUnique(): String = id
}

@JsonClass(generateAdapter = true)
data class BetType(
    @Json(name = "_id")
    var id: String,

    @Json(name = "amount")
    var amount: Int,

    @Json(name = "name")
    var name: String
) : BaseListItem() {
    override fun getUnique(): String = id
}