diff --git a/app/models/client.rb b/app/models/client.rb index 9d58fc865..a605a8c3e 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -46,6 +46,7 @@ class Client < ApplicationRecord attr_readonly :symbol delegate :symbol, to: :provider, prefix: true delegate :consortium_id, to: :provider, allow_nil: true + delegate :salesforce_id, to: :provider, prefix: true, allow_nil: true attr_accessor :password_input, :target_id @@ -630,6 +631,7 @@ def to_jsonapi "url" => url, "re3data_id" => re3data_id, "provider_id" => provider_id, + "provider_salesforce_id" => provider_salesforce_id, "is_active" => is_active.getbyte(0) == 1, "dois_total" => dois_total, "dois_current_year" => dois_current_year, diff --git a/app/models/contact.rb b/app/models/contact.rb index 3013dede7..3d3462720 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -16,6 +16,7 @@ class Contact < ApplicationRecord before_create :set_uid delegate :consortium_id, to: :provider, allow_nil: true + delegate :salesforce_id, to: :provider, prefix: true, allow_nil: true ROLES = %w[voting billing secondary_billing service secondary_service technical secondary_technical] @@ -250,6 +251,7 @@ def to_jsonapi "email" => email, "role_name" => Array.wrap(role_name).map(&:classify), "provider_id" => provider_id.upcase, + "provider_salesforce_id" => provider_salesforce_id, "consortium_id" => consortium_id.present? ? consortium_id.upcase : nil, "created_at" => created_at.try(:iso8601), "updated_at" => updated_at.try(:iso8601),