GoodAnalytics.Connectors.EventMapping (GoodAnalytics v0.1.1)

Copy Markdown View Source

Workspace-scoped mapping from a custom GoodAnalytics event to a connector event.

workspace_id, event_name, and connector_type form the immutable identity of a mapping — they are settable only at creation. Use update_changeset/2 to mutate the delivery configuration (connector_event_name, config, enabled) so a mapping can never be reparented into another workspace.

Summary

Functions

Changeset for creating a custom event connector mapping.

Builds the deterministic mapping snapshot embedded in a dispatch's source_context. This is the single source of truth for the snapshot shape shared by the planner, reconciliation, and the built-in adapters.

Changeset for updating a mapping's delivery configuration.

Functions

changeset(mapping, attrs)

Changeset for creating a custom event connector mapping.

Casts the immutable identity fields plus the delivery configuration.

to_snapshot(mapping)

Builds the deterministic mapping snapshot embedded in a dispatch's source_context. This is the single source of truth for the snapshot shape shared by the planner, reconciliation, and the built-in adapters.

update_changeset(mapping, attrs)

Changeset for updating a mapping's delivery configuration.

Only connector_event_name, config, and enabled are mutable — the identity fields (workspace_id, event_name, connector_type) are frozen so a mapping cannot be moved to another workspace or silently retargeted.