AshSandbox.ProjectTemplate (AshSandbox v0.1.2)

Copy Markdown View Source

A named grouping of environments belonging to one owner (003 T006).

defmodule MyApp.Project do
  use AshSandbox.ProjectTemplate,
    data_layer: AshPostgres.DataLayer,
    domain: MyApp.Sandboxes,
    repo: MyApp.Repo,
    table: "projects"
end

Same template shape and the same reason as AshSandbox.RegistryTemplate: a library-declared resource has its data layer frozen into the beam at library compile time, so the host must own the declaration (012 research R5).

owner_ref replaces tenant_id

A bare string the library stores and compares but never parses, resolves, or joins against (012-FR-007). Axonn supplies its tenant id, and declares the belongs_to to 002's Tenant on its own side — the library has no tenant concept and must compile without one.

The requirement is unchanged by the substitution: 003-FR-002 requires one owner's resources be unreachable from another's, which turns on the values differing, not on what they mean.