use entity_derive::Entity;
use uuid::Uuid;
#[derive(Entity)]
#[entity(table = "users")]
pub struct User {
#[id]
pub id: Uuid,
#[field(create, update, response)]
pub name: String,
#[field(response)]
#[map(empty_to_none)]
pub nickname: Option<String>,
#[field(response)]
#[map(empty_to_none)]
pub bio: Option<String>,
}
fn main() {
let _: fn(CreateUserRequest) = |_| {};
let _: fn(UserResponse) = |_| {};
fn _check_trait<T: UserRepository>() {}
let create = CreateUserRequest {
name: "John".to_string(),
};
let _user: User = create.into();
}