package com.khmer9.lotto.remote

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
class LoginRequest(
    @Json(name = "user_name")
    val username: String,
    @Json(name = "password")
    val password: String
)
@JsonClass(generateAdapter = true)
data class LoginResponse(

    @Json(name = "code")
    val resultCode: String,
    @Json(name = "message")
    val message: LoginMessage,
    @Json(name = "data")
    val data: LoginData?
)

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

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

@JsonClass(generateAdapter = true)
data class LoginData(

    @Json(name="user")
    val user: User?,

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

    @Json(name = "lotoSetResult")
    val lottoSet: List<LottoSet>?,

    @Json(name="limit")
    val limit: Limit?,


    )
@JsonClass(generateAdapter = true)
data class Limit(
    @Json(name="amount_min")
    val amountMin: Int,

    @Json(name="amount_max")
    val amountMax: Int,
)

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

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

    @Json(name = "start_number")
    val startNumber: Int,

    @Json(name = "end_number")
    val endNumber: Int,

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

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

    @Json(name = "type")
    val type: String

)

@JsonClass(generateAdapter = true)
data class User(
    @Json(name = "_id")
    var  id : String,
    @Json(name = "user_name")
    val  userName: String,
    @Json(name = "account_balances")
    val accountBalances: Double,
    @Json(name = "roles")
    val roles:String
)

