A CRM contact (client / customer / prospect).
Cloned in spirit from PhoenixKitStaff.Schemas.Person, with one critical
difference: the link to a PhoenixKit User (user_uuid) is optional —
most contacts never log in. The link is set only when the "allow login"
checkbox is ticked (see PhoenixKitCRM.Contacts), never cast from form
params, so a crafted payload can't link an arbitrary user.
Summary
Functions
Public changeset for create/edit. user_uuid is NOT castable here.
Best human label for a contact.
Sets or clears the optional user_uuid login link (controlled, not from form params).
Types
@type t() :: %PhoenixKitCRM.Schemas.Contact{ __meta__: term(), company_memberships: [PhoenixKitCRM.Schemas.CompanyMembership.t()] | Ecto.Association.NotLoaded.t(), email: String.t() | nil, inserted_at: DateTime.t() | nil, interactions: [PhoenixKitCRM.Schemas.Interaction.t()] | Ecto.Association.NotLoaded.t(), metadata: map(), name: String.t() | nil, notes: String.t() | nil, phone: String.t() | nil, status: String.t() | nil, updated_at: DateTime.t() | nil, user: PhoenixKit.Users.Auth.User.t() | Ecto.Association.NotLoaded.t() | nil, user_uuid: UUIDv7.t() | nil, uuid: UUIDv7.t() | nil }
Functions
@spec changeset(t() | Ecto.Changeset.t(t()), map()) :: Ecto.Changeset.t(t())
Public changeset for create/edit. user_uuid is NOT castable here.
Best human label for a contact.
@spec link_user_changeset(t() | Ecto.Changeset.t(t()), UUIDv7.t() | nil) :: Ecto.Changeset.t(t())
Sets or clears the optional user_uuid login link (controlled, not from form params).
@spec soft_delete_status() :: String.t()
@spec statuses() :: [String.t()]