diff --git a/app/controllers/export_controller.rb b/app/controllers/export_controller.rb index 1dd512abd..44e22c30f 100644 --- a/app/controllers/export_controller.rb +++ b/app/controllers/export_controller.rb @@ -160,6 +160,7 @@ def organizations accountType: provider.member_type_label, generalContactEmail: provider.system_email, groupEmail: provider.group_email, + billingStreetNumber: provider.billing_street_number, billingStreet: provider.billing_address, billingPostalCode: provider.billing_post_code, billingCity: provider.billing_city, diff --git a/app/models/provider.rb b/app/models/provider.rb index 68669f5f1..0a54c3d41 100644 --- a/app/models/provider.rb +++ b/app/models/provider.rb @@ -127,7 +127,8 @@ class Provider < ActiveRecord::Base organization: { type: :text}, department: { type: :text}, city: { type: :text }, - country: { type: :text }, + country: { type: :keyword }, + streetNumber: { type: :text }, address: { type: :text }} indexes :technical_contact, type: :object, properties: { email: { type: :text }, @@ -208,6 +209,7 @@ def as_indexed_json(options={}) "salesforce_id" => salesforce_id, "globus_uuid" => globus_uuid, "billing_information" => { + "streetNumber" => billing_street_number, "address" => billing_address, "organization" => billing_organization, "department" => billing_department, @@ -281,6 +283,7 @@ def csv voting_contact_email: voting_contact_email, voting_contact_given_name: voting_contact_given_name, voting_contact_family_name: voting_contact_family_name, + billing_street_number: billing_street_number, billing_address: billing_address, billing_post_code: billing_post_code, billing_city: billing_city, @@ -388,6 +391,10 @@ def billing_organization billing_information.fetch("organization",nil) if billing_information.present? end + def billing_street_number + billing_information.fetch("street_number",nil) if billing_information.present? + end + def billing_address billing_information.fetch("address",nil) if billing_information.present? end