Resolves the final table archive configuration by merging the resource-level
archive map (built from the DSL) with the domain-level archive defaults.
Priority rules
- Resource has no
AshArchival.Resourceextension → archive isnil, regardless of what the domain provides. Archive cannot be applied to a resource that does not have AshArchival in its extensions. - Resource has
AshArchival.Resourceand an explicitarchiveblock:enabled: falseon the resource block disables archive entirely (used during testing — overrides the domain).- Otherwise the resource block wins per key; missing keys fall back to the domain; missing in both → built-in default for that key.
- Resource has
AshArchival.Resourcebut noarchiveblock:- If the domain defines archive defaults, use them (inherit fully).
- If neither side defines anything, fall back to the built-in defaults
(the canonical
{:master_*, :*}action set). This preserves existing behaviour for resources that just opt in viaAshArchival.
Action value semantics
- Atom value (e.g.
:archived) — used for both master and tenant requests. - Tuple value
{master, tenant}—masterfor users withoutsite_id,tenantfor users scoped to asite_id. Enforcement lives inside the Ash actions themselves; this module only routes which atom to call.
See MishkaGervaz.Table.Transformers.BuildRuntimeConfig (the caller),
MishkaGervaz.Table.Dsl.Defaults (where domain-level archive is set),
and MishkaGervaz.Resource.Info.Table (downstream reader).
Summary
Functions
Returns the final archive map, or nil when archive does not apply.
Functions
Returns the final archive map, or nil when archive does not apply.
resource_archiveis the raw per-resource archive map (ornilif noarchive doblock is present).domain_archiveis the domain-level archive defaults map (ornil).multitenancyis the resource multitenancy info; used to collapse master/tenant tuples to a single atom for non-multitenant resources.has_archival?is whether the resource hasAshArchival.Resourcein its extensions.