Curated, tenant-scoped syndication workflow.
Lock order
All syndication transitions follow the library's canonical lock order —
blogs (sorted by id), then the source post, then the placement row — the
same global order the post-lifecycle paths in BlogEngine.Posts use
(blog before post). Because the source blog id must be known before the
blog locks can be taken, each transaction first performs plain non-locking
reads of the placement and/or post, acquires the blog and post locks in
canonical order, and then re-verifies that the rows still reference the
same blogs before proceeding.
Summary
Functions
Approves a requested syndication placement.
Lists one bounded page of requested placements for a tenant target blog.
Rejects a requested placement with a nonblank host-supplied reason.
Requests curated placement of a source post on a target blog.
Creates or reactivates an immediately approved curator-selected placement.
Withdraws an active request or approved placement.
Types
@type result() :: {:ok, BlogEngine.Schema.Syndication.t()} | {:error, BlogEngine.Error.t() | Ecto.Changeset.t()}
Functions
@spec approve(BlogEngine.Context.t(), Ecto.UUID.t()) :: result()
Approves a requested syndication placement.
@spec list_requests(BlogEngine.Context.t(), Ecto.UUID.t(), keyword()) :: {:ok, BlogEngine.Page.t(BlogEngine.Syndication.RequestEntry.t())} | {:error, BlogEngine.Error.t()}
Lists one bounded page of requested placements for a tenant target blog.
@spec reject(BlogEngine.Context.t(), Ecto.UUID.t(), String.t()) :: result()
Rejects a requested placement with a nonblank host-supplied reason.
@spec request(BlogEngine.Context.t(), Ecto.UUID.t(), Ecto.UUID.t()) :: result()
Requests curated placement of a source post on a target blog.
@spec select(BlogEngine.Context.t(), Ecto.UUID.t(), Ecto.UUID.t()) :: result()
Creates or reactivates an immediately approved curator-selected placement.
@spec withdraw(BlogEngine.Context.t(), Ecto.UUID.t()) :: result()
Withdraws an active request or approved placement.