PhoenixKitCatalogue.Export.UniversalJson (PhoenixKitCatalogue v0.9.0)

Copy Markdown View Source

Universal JSON export encoder.

Produces a generic, destination-agnostic JSON dump of catalogue items across one or more catalogues.

Output shape

{
  "catalogues": [{"uuid": "...", "name": "..."}, ...],
  "exported_at": "2026-06-26T16:00:00Z",
  "index": 1111111111,
  "items": [
    {"name": "...", "sku": "...", "base_price": "2222.00", "unit": "piece", "catalogue": "..."}
  ]
}

Filename includes the export date and local time (YYYY-MM-DD HH-MM): a single catalogue is named after the catalogue (e.g. "My Catalogue 2026-06-26 19-19.json"); multiple catalogues produce "Catalogues 2026-06-26 19-19.json".

Summary

Functions

Renders the universal JSON export.

Functions

render(ctx)

Renders the universal JSON export.

ctx must have keys:

  • :items — list of items (with :catalogue association preloaded)
  • :index — unix timestamp integer
  • :catalogues — list of catalogue structs

Returns {filename, iodata, mime_type}.