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";
}