Proca.Contact (proca v3.0.2)

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.

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(),
  confirm_processing: term(),
  contact_schema: term(),
  custom_action_confirm: term(),
  custom_action_deliver: term(),
  custom_supporter_confirm: term(),
  email_backend: term(),
  email_backend_id: term(),
  email_from: term(),
  email_opt_in: term(),
  email_opt_in_template: term(),
  event_backend: term(),
  event_backend_id: term(),
  event_processing: term(),
  high_security: term(),
  id: term(),
  inserted_at: term(),
  name: term(),
  public_keys: term(),
  services: term(),
  staffers: term(),
  system_sqs_deliver: term(),
  template_backend: term(),
  template_backend_id: 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

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

spread(new_contact, list)