package com.zyzf.coffeepreorder.api.model

import com.zyzf.coffeepreorder.database.model.User
import kotlinx.serialization.Serializable

@Serializable
data class UserRemote(
    val id: Int = 0,
    val login: String = "",
    val fio: String = "",
    val phone: String = "",
    val password: String = "",
    val role: String = ""
)

fun UserRemote.toUser(): User = User(
    id,
    login,
    fio,
    phone,
    password,
    role
)

fun User.toUserRemote(): UserRemote = UserRemote(
    uid,
    login,
    fio,
    phone,
    password,
    role
)