The contract a resource of a resource package must keep, one module per
rule (data-model.md § Validation rules):
Multitenancy: attribute multitenancy ontenant_id, not global.DataLayer: AshPostgres onAlternera.Resource.Repo, in the package's schemaresources_<package id>.Policies: the policy prefix comes first.LookupKey: a lookup key is unique per tenant through an identity on it alone.Expose: every exposed route and action exists, with the right type.ListFields: the list fields are public attributes.PaperTrail: the paper trail is on, in snapshot mode, with versions on destroy.Cache:cacheisfalse,trueor[ttl_ms: n]with n > 0.TenantReferences: everybelongs_tois matched ontenant_id.UI: theuisection names public attributes, unique ids and Ash actions that fit what each action acts on.
Alternera.Resource.Transformers.Verify runs them at compile time;
problems/1 runs them on a compiled resource, for the contract test kit.
Summary
Functions
What use Alternera.Resource recorded about the resource
(%{package_id, resource_id, table, schema}), or nil for a resource that
adds the extension without it.
The rules a resource breaks, as {rule, message}, for a compiled module or
a DSL state during compilation. Empty when it keeps the contract.
The rule modules, in order.
Functions
What use Alternera.Resource recorded about the resource
(%{package_id, resource_id, table, schema}), or nil for a resource that
adds the extension without it.
The rules a resource breaks, as {rule, message}, for a compiled module or
a DSL state during compilation. Empty when it keeps the contract.
@spec rules() :: [module()]
The rule modules, in order.