package com.sambath.kunkhmer.extension

import com.sambath.kunkhmer.remote.NewsDetail
import com.sambath.kunkhmer.remote.NewsDetailData
import com.sambath.kunkhmer.remote.ResponseMessage
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass

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

@JsonClass(generateAdapter = true)
data class CurrentUserData(
    @Json(name = "object")
    val obj: CurrentUser,
)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    @Json(name = "file_id")
    val file_id: FileId,
)

@JsonClass(generateAdapter = true)
data class FileId(
    @Json(name = "fieldname")
    val fieldname: String,
    @Json(name = "originalname")
    val originalname: String,
    @Json(name = "encoding")
    val encoding: String,
    @Json(name = "mimetype")
    val mimetype: String,
    @Json(name = "id")
    val id: String,
    @Json(name = "filename")
    val filename: String,
    @Json(name = "metadata")
    val metadata: String?,
    @Json(name = "bucketName")
    val bucketName: String,
    @Json(name = "chunkSize")
    val chunkSize: Int,
    @Json(name = "size")
    val size: Int,
    @Json(name = "md5")
    val md5: String,
    @Json(name = "uploadDate")
    val uploadDate: String,
    @Json(name = "contentType")
    val contentType: String,
)
