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 MainResponse(
    @Json(name = "code")
    val resultCode: String,

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

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

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

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

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

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

    @Json(name = "currentResult")
    val result: Result?,

    @Json(name = "currentBetting")
    val myBetting: MyBetting?
)

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

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

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

    @Json(name = "set_result_id")
    var setId: String,

    @Json(name = "type_of_betting")
    val typeOfBetting: String,

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

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

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

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

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

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

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

@JsonClass(generateAdapter = true)
data class Result(

    @Json(name = "_id")
    var id: String,

    @Json(name = "no")
    var no: String,

    @Json(name = "total_ramdom")
    var totalValue: String,

    @Json(name = "set_result_id")
    var smallBigSetId: String,

    @Json(name = "type_of_betting")
    val resultSmallOrBig: String,

    @Json(name = "category")
    var categorySmallOrBig: String,

    @Json(name = "set_result_id_range")
    var rangeSetId: String,

    @Json(name = "type_of_betting_range")
    val resultRange: String,

    @Json(name = "category_range")
    var categoryRange: String
)

