Proca.Contact (proca v3.3.1)

Schema holding personal data (PII). Belongs to action page that collected the data, and to organisation which the data is sent to. Contains consent information. Can be encrypted. There can be many Contact records per one supporter (=per one action)

Link to this section Summary

Functions

Encrypt this contact changeset for a list of keys. Returns lists of Contact records with payload encrypted for each key.

If necessary, update and unencrypted contact with active key

Link to this section Functions

Link to this function

add_consent(contact_ch, consent)

Link to this function

add_encryption(contact_ch, org)

Specs

add_encryption(Ecto.Changeset.t(Proca.Contact), %Proca.Org{
  __meta__: term(),
  action_pages: term(),
  action_schema_version: term(),
  campaigns: term(),
  config: term(),
  contact_schema: term(),
  custom_action_confirm: term(),
  custom_action_deliver: term(),
  custom_event_deliver: term(),
  custom_supporter_confirm: term(),
  detail_backend: term(),
  detail_backend_id: term(),
  doi_thank_you: term(),
  email_backend: term(),
  email_backend_id: term(),
  email_from: term(),
  event_backend: term(),
  event_backend_id: term(),
  high_security: term(),
  id: term(),
  inserted_at: term(),
  name: term(),
  public_keys: term(),
  push_backend: term(),
  push_backend_id: term(),
  services: term(),
  staffers: term(),
  storage_backend: term(),
  storage_backend_id: term(),
  supporter_confirm: term(),
  supporter_confirm_template: term(),
  title: term(),
  updated_at: term()
}) :: Ecto.Changeset.t(Proca.Contact)
Link to this function

base_decode(encoded)

Link to this function

base_encode(data)

Link to this function

build(contact_data)

Specs

build(struct()) ::
  Ecto.Changeset.t(%Proca.Contact{
    __meta__: term(),
    communication_consent: term(),
    communication_scopes: term(),
    crypto_nonce: term(),
    delivery_consent: term(),
    id: term(),
    inserted_at: term(),
    org: term(),
    org_id: term(),
    payload: term(),
    public_key: term(),
    public_key_id: term(),
    sign_key: term(),
    sign_key_id: term(),
    supporter: term(),
    supporter_id: term(),
    updated_at: term()
  })
Link to this function

change_for_org(contacts, org, attrs)

Link to this function

encrypt(contact_ch, list)

Specs

encrypt(Ecto.Changeset.t(Proca.Contact), [
  %Proca.PublicKey{
    __meta__: term(),
    active: term(),
    expired: term(),
    id: term(),
    inserted_at: term(),
    name: term(),
    org: term(),
    org_id: term(),
    private: term(),
    public: term(),
    updated_at: term()
  }
]) :: [Ecto.Changeset.t(Proca.Contact)]

Encrypt this contact changeset for a list of keys. Returns lists of Contact records with payload encrypted for each key.

Link to this function

ensure_encrypted!(contact)

If necessary, update and unencrypted contact with active key

Link to this function

spread(new_contact, list)