slave 0.4.0

Laravel-inspired CLI for Rust MCP servers: scaffold apps whose business operations are MCP tools over Streamable HTTP, with built-in auth, users, roles and Turso migrations
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use crate::modules::user::models::user::User;

/// Arguments of tools that act on one user.
#[derive(Debug, Deserialize, JsonSchema)]
pub struct UserIdRequest {
    pub user_id: i64,
}

/// Public representation of a user (never includes the password hash).
#[derive(Debug, Serialize, JsonSchema)]
pub struct UserResponse {
    pub id: i64,
    pub name: String,
    pub email: String,
    pub created_at: String,
}

/// Result of `user_list`.
#[derive(Debug, Serialize, JsonSchema)]
pub struct UserListResponse {
    pub users: Vec<UserResponse>,
}

/// Result of `user_delete`.
#[derive(Debug, Serialize, JsonSchema)]
pub struct DeletedUserResponse {
    pub deleted: bool,
    pub id: i64,
}

impl From<User> for UserResponse {
    fn from(user: User) -> Self {
        Self {
            id: user.id,
            name: user.name,
            email: user.email,
            created_at: user.created_at,
        }
    }
}