VatchexGreece.Prettify (VatchexGreece v1.2.0)

Copy Markdown View Source

Optional post-processing for VatchexGreece.fetch/1 results.

Reshapes the raw GSIS response map into a more ergonomic form:

  • Adds afm_full derived from afm.
  • Combines postal address fields into a %{street_address: ..., raw: ...} submap.
  • Adds is_active derived from stop_date.
  • Reshapes activities list into %{primary: map | nil, secondary: [maps]}.

Pass pretty: true to fetch/1 to apply this automatically.

Summary

Functions

Reshape a successful fetch result.

Functions

pretty(arg)

Reshape a successful fetch result.

Transparently passes through {:error, reason} tuples unchanged.