use bon::Builder;
use nil_core::player::PlayerId;
use nil_crypto::password::Password;
use serde::{Deserialize, Serialize};
#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
#[cfg_attr(feature = "typescript", ts(export))]
pub struct CreateUserRequest {
#[builder(into)]
pub player: PlayerId,
#[builder(into)]
pub password: Password,
}
#[derive(Builder, Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
#[cfg_attr(feature = "typescript", derive(ts_rs::TS))]
#[cfg_attr(feature = "typescript", ts(export))]
pub struct UserExistsRequest {
#[builder(into)]
pub user: PlayerId,
}
impl<T> From<T> for UserExistsRequest
where
T: Into<PlayerId>,
{
fn from(value: T) -> Self {
Self::builder().user(value).build()
}
}