package com.example.shawarma.data.api.models

import com.example.shawarma.data.models.UserModel
import kotlinx.serialization.Serializable

@Serializable
data class TokenModelRemote(
    val access_token: String = "",
    val message: String = ""
)

@Serializable
data class UserModelRemote(
    val id: Int = 0,
    val login: String = "",
    val password:String = "",
    val role:String = "",
    val message: String = ""
)

fun UserModelRemote.toUserModel(): UserModel = UserModel(
    id, login, password, role
)

fun UserModel.toUserModelRemote(): UserModelRemote = UserModelRemote(
    login = login, password = password, role = role
)