Tenant-scoped blog configuration commands and reads.
Explicit nil attribute policy
Attribute maps distinguish an absent key from a key whose value is nil.
- An absent key never reaches the changeset.
- An explicit
nilclears the column only for the nullable optional field:default_author_id. - An explicit
nilfor any other field — including theNOT NULLdefaulted:navigation_label,:enabled,:route_params,:publication_policy, and:features— is ignored exactly as if the key had been omitted, so those fields fall back to the schema default on create and keep their stored value on update instead of raising aNOT NULLviolation.
Summary
Functions
Creates one durable blog for a tenant publisher.
Disables a blog while preserving its durable identity and history.
Re-enables a disabled durable blog.
Returns the durable tenant publisher blog, creating it when absent.
Gets a blog by tenant-scoped ID.
Gets the durable blog for a tenant publisher identity.
Lists tenant blogs in stable publisher, name, and ID order.
Updates non-routing presentation and publication settings.
Atomically updates presentation settings and the blog's complete route set.
Functions
@spec create(BlogEngine.Context.t(), map()) :: {:ok, BlogEngine.Schema.Blog.t()} | {:error, BlogEngine.Error.t() | Ecto.Changeset.t()}
Creates one durable blog for a tenant publisher.
Explicit nil values follow the module's nil policy: they clear only
:default_author_id and are otherwise ignored.
@spec disable(BlogEngine.Context.t(), Ecto.UUID.t()) :: {:ok, BlogEngine.Schema.Blog.t()} | {:error, BlogEngine.Error.t() | Ecto.Changeset.t()}
Disables a blog while preserving its durable identity and history.
@spec enable(BlogEngine.Context.t(), Ecto.UUID.t()) :: {:ok, BlogEngine.Schema.Blog.t()} | {:error, BlogEngine.Error.t() | Ecto.Changeset.t()}
Re-enables a disabled durable blog.
@spec ensure_for_publisher( BlogEngine.Context.t(), String.t(), String.t(), map(), keyword() ) :: {:ok, BlogEngine.Schema.Blog.t()} | {:error, BlogEngine.Error.t() | Ecto.Changeset.t()}
Returns the durable tenant publisher blog, creating it when absent.
Publisher identity is supplied separately and cannot be overridden through
attrs. The only accepted option is :id, which allows a host to provision
a deterministic UUID. An already-existing publisher is returned unchanged.
Concurrent callers converge on the publisher created by the winning call.
@spec get(BlogEngine.Context.t(), Ecto.UUID.t()) :: {:ok, BlogEngine.Schema.Blog.t()} | {:error, BlogEngine.Error.t()}
Gets a blog by tenant-scoped ID.
@spec get_for_publisher(BlogEngine.Context.t(), String.t(), String.t()) :: {:ok, BlogEngine.Schema.Blog.t()} | {:error, BlogEngine.Error.t()}
Gets the durable blog for a tenant publisher identity.
@spec list( BlogEngine.Context.t(), keyword() ) :: [BlogEngine.Schema.Blog.t()]
Lists tenant blogs in stable publisher, name, and ID order.
@spec update(BlogEngine.Context.t(), Ecto.UUID.t(), map()) :: {:ok, BlogEngine.Schema.Blog.t()} | {:error, BlogEngine.Error.t() | Ecto.Changeset.t()}
Updates non-routing presentation and publication settings.
Explicit nil values follow the module's nil policy: they clear only
:default_author_id and are otherwise ignored.
@spec update_configuration(BlogEngine.Context.t(), Ecto.UUID.t(), map()) :: {:ok, BlogEngine.Schema.Blog.t()} | {:error, BlogEngine.Error.t() | Ecto.Changeset.t()}
Atomically updates presentation settings and the blog's complete route set.
Route changes use the routing lifecycle, so current and former post routes, audit records, and notifications are committed together with presentation changes. A failure in either half rolls the whole configuration update back.