# `PhoenixKitDocumentCreator.Documents.Composer`
[🔗](https://github.com/BeamLabEU/phoenix_kit_document_creator/blob/0.4.8/lib/phoenix_kit_document_creator/documents/composer.ex#L1)

Composition orchestration for documents built from multiple template sections.

Public entry point: `compose/2`. This module is the implementation behind
`PhoenixKitDocumentCreator.Documents.create_composed_document/2`.

# `section_input`

```elixir
@type section_input() :: %{
  template_uuid: UUIDv7.t(),
  position: non_neg_integer(),
  variable_values: map(),
  image_params: map()
}
```

# `compose`

```elixir
@spec compose(
  [section_input()],
  keyword()
) :: {:ok, PhoenixKitDocumentCreator.Schemas.Document.t()} | {:error, term()}
```

# `validate_sections`

```elixir
@spec validate_sections(
  [section_input()],
  keyword()
) ::
  :ok
  | {:error,
     :empty_sections
     | {:duplicate_positions, [non_neg_integer()]}
     | {:unknown_templates, [UUIDv7.t()]}
     | {:unpublished_templates, [UUIDv7.t()]}}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
