View Source Glific.Contacts.Contact (Glific v5.1.6)

The minimal wrapper for the base Contact structure

Link to this section Summary

Functions

Standard changeset pattern we use for all data types

Populate virtual field of masked phone number

Link to this section Types

@type t() :: %Glific.Contacts.Contact{
  __meta__: Ecto.Schema.Metadata.t(),
  active_profile:
    Glific.Profiles.Profile.t() | Ecto.Association.NotLoaded.t() | nil,
  active_profile_id: non_neg_integer() | nil,
  bsp_status: Glific.Enums.ContactProviderStatus | nil,
  fields: map() | nil,
  groups: term(),
  id: non_neg_integer() | nil,
  inserted_at: :utc_datetime_usec | nil,
  is_contact_replied: boolean(),
  is_org_read: boolean(),
  is_org_replied: boolean(),
  language: Glific.Settings.Language.t() | Ecto.Association.NotLoaded.t() | nil,
  language_id: non_neg_integer() | nil,
  last_communication_at: :utc_datetime | nil,
  last_message_at: :utc_datetime | nil,
  last_message_number: integer(),
  masked_phone: String.t() | nil,
  name: String.t() | nil,
  optin_message_id: String.t() | nil,
  optin_method: String.t() | nil,
  optin_status: boolean() | nil,
  optin_time: :utc_datetime | nil,
  optout_method: String.t() | nil,
  optout_time: :utc_datetime | nil,
  organization:
    Glific.Partners.Organization.t() | Ecto.Association.NotLoaded.t() | nil,
  organization_id: non_neg_integer() | nil,
  phone: String.t() | nil,
  settings: map() | nil,
  status: Glific.Enums.ContactStatus | nil,
  tags: term(),
  updated_at: :utc_datetime_usec | nil,
  user: Glific.Users.User.t() | Ecto.Association.NotLoaded.t() | nil
}

Link to this section Functions

Link to this function

changeset(contact, attrs)

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

Standard changeset pattern we use for all data types

Link to this function

populate_masked_phone(contact)

View Source
@spec populate_masked_phone(t()) :: t()

Populate virtual field of masked phone number