use surrealdb::types::{Datetime, SurrealValue};
/// An app of this project (`app:<id>`), named like its folder in `apps/`.
#[derive(Debug, Clone, SurrealValue)]
pub struct App {
pub id: i64,
/// The folder name, e.g. `admin` for `apps/admin`.
pub name: String,
/// The team that owns the app; `None` until a super admin assigns one.
pub owner_team_id: Option<i64>,
pub created_at: Datetime,
}
impl App {
/// What to select for this struct: every field, with the numeric `id`,
/// e.g. `SELECT {FIELDS} FROM app WHERE ...`.
pub const FIELDS: &str = "*, record::id(id) AS id";
}