package com.sambath.kunkhmer.remote

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

@JsonClass(generateAdapter = true)
data class EventResponse(
    @Json(name = "code")
    val resultCode: Int,
    @Json(name = "message")
    val message: ResponseMessage,
    @Json(name = "data")
    val data: EventData?
)

@JsonClass(generateAdapter = true)
data class EventData(
    @Json(name = "object")
    val obj: MutableList<EventInfo>,
)

@JsonClass(generateAdapter = true)
data class EventInfo(
    @Json(name = "_id")
    val eventInfoId: EventInfoId,
    @Json(name = "fighters")
    val fighters: MutableList<EventInfoFighters>,
)

@JsonClass(generateAdapter = true)
data class EventInfoId(
    @Json(name = "_id")
    val id: String,
    @Json(name = "title")
    val title: String,
    @Json(name = "desc")
    val desc: String,
    @Json(name = "status")
    val status: Boolean,
    @Json(name = "fighter_id")
    val fighterId: String,
    @Json(name = "createdAt")
    val createdAt: String,
)

@JsonClass(generateAdapter = true)
data class EventInfoFighters(
    @Json(name = "_id")
    val id: String,
    @Json(name = "name")
    val name: String,
    @Json(name = "desc")
    val desc: String,
    @Json(name = "weight")
    val weight: String,
    @Json(name = "high")
    val height: String,
    @Json(name = "nationality")
    val nationality: String,
    @Json(name = "status")
    val status: Boolean,
    @Json(name = "filename")
    val filename: String,
)

////////

@JsonClass(generateAdapter = true)
class CreateEventRequest(
    @Json(name = "title")
    val title: String,
    @Json(name = "desc")
    val desc: String,
    @Json(name = "match_fighter_id")
    val matchFighterId: String
)

@JsonClass(generateAdapter = true)
data class CreateEventResponse(
    @Json(name = "code")
    val resultCode: Int,
    @Json(name = "message")
    val message: ResponseMessage,
    @Json(name = "data")
    val data: EventCreatedData?
)

@JsonClass(generateAdapter = true)
data class EventCreatedData(
    @Json(name = "event")
    val obj: CreatedEvent,
)

@JsonClass(generateAdapter = true)
data class CreatedEvent(
    @Json(name = "status")
    val status: Boolean,

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

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

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

    @Json(name = "match_fighter_id")
    val matchFighterId: String,

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

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

    @Json(name = "__v")
    val _v: Int,
)
