package com.sambath.kunkhmer.remote

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

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

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

@JsonClass(generateAdapter = true)
data class Highlight(
    @Json(name = "_id")
    val id: String,
    @Json(name = "title")
    val title: String,
    @Json(name = "date")
    val date: String,
    @Json(name = "url")
    val url: String,
    @Json(name = "createdAt")
    val createdAt: String,
)

/////////

@JsonClass(generateAdapter = true)
class CreateHighlightRequest(
    @Json(name = "title")
    val title: String,
    @Json(name = "date")
    val date: String,
    @Json(name = "url")
    val url: String
)

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

@JsonClass(generateAdapter = true)
data class HighlightCreatedData(
    @Json(name = "highLight")
    val obj: CreatedHighlight,
)

@JsonClass(generateAdapter = true)
data class CreatedHighlight(
    @Json(name = "_id")
    val id: String,
    @Json(name = "title")
    val title: String,
    @Json(name = "date")
    val date: String,
    @Json(name = "url")
    val url: String,
    @Json(name = "createdAt")
    val createdAt: String,
    @Json(name = "updatedAt")
    val updatedAt: String,
    @Json(name = "__v")
    val _v: Int,
)