Context for CRM interactions — the History/Interactions tab.
Handles the logged interaction itself, its resolvable "involved parties"
(flat list, no per-party role), the as-of-then party_snapshot captured on
save, and the reverse "all interactions involving this contact" query
(subject OR party).
Summary
Functions
Creates an interaction and (re)builds its party list. party_inputs is a
list of maps with :raw_name (required) and an optional resolved reference
(:contact_uuid OR :staff_person_uuid). The snapshot is captured here.
UUIDs of the interactions a contact is the subject of (for the Files rollup).
Interactions logged on any of the given contacts (as subject), newest first, with the subject contact + parties preloaded. Powers the company's aggregated read-only interactions feed.
Lists every interaction that involves the given contact — whether they are
the subject (interactions.contact_uuid) or an involved party
(interaction_parties.contact_uuid). Newest first; parties preloaded.
Functions
@spec change_interaction(PhoenixKitCRM.Schemas.Interaction.t(), map()) :: Ecto.Changeset.t()
@spec create_interaction(map(), [map()], [binary()]) :: {:ok, PhoenixKitCRM.Schemas.Interaction.t()} | {:error, Ecto.Changeset.t()}
Creates an interaction and (re)builds its party list. party_inputs is a
list of maps with :raw_name (required) and an optional resolved reference
(:contact_uuid OR :staff_person_uuid). The snapshot is captured here.
@spec delete_interaction( PhoenixKitCRM.Schemas.Interaction.t(), keyword() ) :: {:ok, PhoenixKitCRM.Schemas.Interaction.t()} | {:error, Ecto.Changeset.t()}
@spec get_interaction(UUIDv7.t() | String.t() | nil) :: PhoenixKitCRM.Schemas.Interaction.t() | nil
UUIDs of the interactions a contact is the subject of (for the Files rollup).
@spec list_for_contacts([binary()]) :: [PhoenixKitCRM.Schemas.Interaction.t()]
Interactions logged on any of the given contacts (as subject), newest first, with the subject contact + parties preloaded. Powers the company's aggregated read-only interactions feed.
@spec list_involving(UUIDv7.t() | String.t() | nil) :: [ PhoenixKitCRM.Schemas.Interaction.t() ]
Lists every interaction that involves the given contact — whether they are
the subject (interactions.contact_uuid) or an involved party
(interaction_parties.contact_uuid). Newest first; parties preloaded.
@spec update_interaction( PhoenixKitCRM.Schemas.Interaction.t(), map(), [map()] | nil, keyword() ) :: {:ok, PhoenixKitCRM.Schemas.Interaction.t()} | {:error, Ecto.Changeset.t()}