package com.khmer9.kdmain.screen.detail

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

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

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

    @Json(name = "data")
    val data: List<BettingDetailData>
)

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

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

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

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

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

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

    @Json(name = "bet_type")
    val betType: BetType,

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

    @Json(name = "bet_result")
    val betResult: BetResult,

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

@JsonClass(generateAdapter = true)
data class BetResult(
    @Json(name = "is_win")
    val isWin: Boolean?,

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

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

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

    @Json(name = "payout")
    val payout: Double,
)

////////////// YUKI DETAIL

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

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

    @Json(name = "data")
    val data: List<BettingDetailYukiData>
)

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

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

    @Json(name = "bet_type")
    val betType: BetType,

    @Json(name = "return_amount")
    val returnAmount: String,

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

    @Json(name = "bet_result")
    val betResult: BetResult,

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

////////////// LOTTO PLUS

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

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

    @Json(name = "data")
    val data: List<BettingDetailLottoPlusData>
)

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

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

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

    @Json(name = "bet_color")
    val betColor: String,

    @Json(name = "bet_type")
    val betType: String,

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

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