PhoenixKitDocumentCreator.Schemas.TemplatePreset (PhoenixKitDocumentCreator v0.4.3)

Copy Markdown View Source

Schema for named, reusable template compositions.

A preset captures an ordered list of section descriptors (template uuid, position, variable defaults, image params) that can be applied to a new document to produce a multi-section composition in one step.

Scope convention (Stage 1, no migration)

Presets are associated with the document taxonomy by repurposing the generic scope pair:

  • scope_id — owning Category uuid (always set for managed presets)
  • scope_type — owning Type uuid, or nil for category-wide presets

A future migration will replace this with real category_uuid / type_uuid foreign keys (see the design spec).

The sections field is a JSONB array where each element is a map describing one section (keys: template_uuid, position, variable_values, image_params). Image substitution is restricted to PNG, JPEG, and GIF formats; enforcement happens at the context layer.

Summary

Types

t()

@type t() :: %PhoenixKitDocumentCreator.Schemas.TemplatePreset{
  __meta__: term(),
  created_by_uuid: term(),
  description: term(),
  inserted_at: term(),
  name: term(),
  scope_id: term(),
  scope_type: term(),
  sections: term(),
  updated_at: term(),
  uuid: term()
}

Functions

changeset(preset, attrs)