PhoenixKitCRM.Schemas.InteractionParty (PhoenixKitCRM v0.2.4)

Copy Markdown View Source

An "involved party" on an interaction — a flat, resolvable mention.

raw_name is always kept (the typed text / display fallback). A party resolves to a CRM Contact (contact_uuid) or a staff person (staff_person_uuid, a soft ref — no FK — so the staff module stays optional), at most one (exclusive-arc). party_snapshot freezes the party's profile as it was at log time, so the record is true to that moment even after the person changes role or is deleted.

There is no per-party role by design (see the v1 design note): a business relationship-role belongs on a durable contact↔company edge, not on an interaction.

Summary

Types

t()

@type t() :: %PhoenixKitCRM.Schemas.InteractionParty{
  __meta__: term(),
  contact:
    PhoenixKitCRM.Schemas.Contact.t() | Ecto.Association.NotLoaded.t() | nil,
  contact_uuid: UUIDv7.t() | nil,
  inserted_at: DateTime.t() | nil,
  interaction:
    PhoenixKitCRM.Schemas.Interaction.t() | Ecto.Association.NotLoaded.t() | nil,
  interaction_uuid: UUIDv7.t() | nil,
  party_snapshot: map(),
  position: integer(),
  raw_name: String.t() | nil,
  staff_person_uuid: UUIDv7.t() | nil,
  updated_at: DateTime.t() | nil,
  uuid: UUIDv7.t() | nil
}

Functions

changeset(party, attrs)

@spec changeset(t() | Ecto.Changeset.t(t()), map()) :: Ecto.Changeset.t(t())