package com.khmer9.yuki.remote

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

@JsonClass(generateAdapter = true)
class ReportResultRequest(
    @Json(name = "start_date")
    val startDate: String,

    @Json(name = "end_date")
    val endDate: String,

    @Json(name = "rows_per_page")
    val rowPerPage: Int,

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

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

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

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

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

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

@JsonClass(generateAdapter = true)
data class ReportResultData(
    @Json(name = "results")
    val resultList: List<StatementResult>?
)

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

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

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

    @Json(name = "small_large")
    val smallLarge: ResultSmallLarge,

    @Json(name = "bonus")
    val resultBonus: ResultBonus,

    @Json(name = "range")
    val resultRange: ResultRange,

    @Json(name = "blue_red")
    val resultBlueRed: ResultBlueRed,

    @Json(name = "odd_even")
    val resultOddEven: ResultOddEven,

    @Json(name = "year")
    val resultYear: ResultYear,

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

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

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

    @Json(name = "year_number")
    val yearNumber: Int,
)

@JsonClass(generateAdapter = true)
data class ResultBonus(
    @Json(name = "year_number")
    val yearNumber: Int,

    @Json(name = "is_bonus")
    val isBonus: Boolean,

    @Json(name = "payout")
    val payout: Int
)

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

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

    @Json(name = "year_number")
    val yearNumber: Int,
)

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

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

    @Json(name = "year_number")
    val yearNumber: Int,
)

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

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

    @Json(name = "year_number")
    val yearNumber: Int,
)

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

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

    @Json(name = "year_number")
    val yearNumber: Int,
)



