slave 0.13.1

CLI for slave, a Laravel-inspired Rust framework for MCP-first apps: scaffold an MCP backend with auth, roles, teams and SurrealDB migrations, add server-rendered web apps, and route them by domain or path
use surrealdb::types::{Datetime, SurrealValue};

/// A team (`team:<id>`, a tenant): a group of users working together, e.g.
/// one shop or one company. Deleting a team deletes its memberships and
/// invitations (see the migration).
#[derive(Debug, Clone, SurrealValue)]
pub struct Team {
    pub id: i64,

    pub name: String,

    /// Lowercase letters, digits and `-`; used in URLs, e.g. `{team}.example.com`.
    pub slug: String,

    pub created_at: Datetime,
}

impl Team {
    /// What to select for this struct: every field, with the numeric `id`,
    /// e.g. `SELECT {FIELDS} FROM team WHERE ...`.
    pub const FIELDS: &str = "*, record::id(id) AS id";
}