Skip to content

Commit

Permalink
update contact metadata stored with provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Mar 5, 2021
1 parent cbca117 commit 11bbc56
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
14 changes: 7 additions & 7 deletions app/controllers/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,19 +427,19 @@ def safe_params
"nonProfitStatus",
"salesforceId",
"technicalContact",
{ "technicalContact": [:email, "givenName", "familyName"] },
{ "technicalContact": [:uid, :email, "givenName", "familyName", :name] },
"secondaryTechnicalContact",
{ "secondaryTechnicalContact": [:email, "givenName", "familyName"] },
{ "secondaryTechnicalContact": [:uid, :email, "givenName", "familyName", :name] },
"secondaryBillingContact",
{ "secondaryBillingContact": [:email, "givenName", "familyName"] },
{ "secondaryBillingContact": [:uid, :email, "givenName", "familyName", :name] },
"billingContact",
{ "billingContact": [:email, "givenName", "familyName"] },
{ "billingContact": [:uid, :email, "givenName", "familyName", :name] },
"serviceContact",
{ "serviceContact": [:email, "givenName", "familyName"] },
{ "serviceContact": [:uid, :email, "givenName", "familyName", :name] },
"secondaryServiceContact",
{ "secondaryServiceContact": [:email, "givenName", "familyName"] },
{ "secondaryServiceContact": [:uid, :email, "givenName", "familyName", :name] },
"votingContact",
{ "votingContact": [:email, "givenName", "familyName"] },
{ "votingContact": [:uid, :email, "givenName", "familyName", :name] },
],
keys: {
"displayName" => :display_name,
Expand Down
16 changes: 8 additions & 8 deletions app/controllers/v3/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def set_include
if params[:include].present?
@include =
params[:include].split(",").map { |i| i.downcase.underscore.to_sym }
@include = @include & %i[consortium consortium_organizations contacts]
@include = @include & %i[contacts]
else
@include = []
end
Expand Down Expand Up @@ -423,19 +423,19 @@ def safe_params
"nonProfitStatus",
"salesforceId",
"technicalContact",
{ "technicalContact": [:email, "givenName", "familyName"] },
{ "technicalContact": [:uid, :email, "givenName", "familyName", :name] },
"secondaryTechnicalContact",
{ "secondaryTechnicalContact": [:email, "givenName", "familyName"] },
{ "secondaryTechnicalContact": [:uid, :email, "givenName", "familyName", :name] },
"secondaryBillingContact",
{ "secondaryBillingContact": [:email, "givenName", "familyName"] },
{ "secondaryBillingContact": [:uid, :email, "givenName", "familyName", :name] },
"billingContact",
{ "billingContact": [:email, "givenName", "familyName"] },
{ "billingContact": [:uid, :email, "givenName", "familyName", :name] },
"serviceContact",
{ "serviceContact": [:email, "givenName", "familyName"] },
{ "serviceContact": [:uid, :email, "givenName", "familyName", :name] },
"secondaryServiceContact",
{ "secondaryServiceContact": [:email, "givenName", "familyName"] },
{ "secondaryServiceContact": [:uid, :email, "givenName", "familyName", :name] },
"votingContact",
{ "votingContact": [:email, "givenName", "familyName"] },
{ "votingContact": [:uid, :email, "givenName", "familyName", :name] },
],
keys: {
"displayName" => :display_name,
Expand Down
14 changes: 14 additions & 0 deletions app/models/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,51 +274,65 @@ class Provider < ApplicationRecord
indexes :technical_contact,
type: :object,
properties: {
uid: { type: :keyword },
email: { type: :text },
given_name: { type: :text },
family_name: { type: :text },
name: { type: :text },
}
indexes :secondary_technical_contact,
type: :object,
properties: {
uid: { type: :keyword },
email: { type: :text },
given_name: { type: :text },
family_name: { type: :text },
name: { type: :text },
}
indexes :billing_contact,
type: :object,
properties: {
uid: { type: :keyword },
email: { type: :text },
given_name: { type: :text },
family_name: { type: :text },
name: { type: :text },
}
indexes :secondary_billing_contact,
type: :object,
properties: {
uid: { type: :keyword },
email: { type: :text },
given_name: { type: :text },
family_name: { type: :text },
name: { type: :text },
}
indexes :service_contact,
type: :object,
properties: {
uid: { type: :keyword },
email: { type: :text },
given_name: { type: :text },
family_name: { type: :text },
name: { type: :text },
}
indexes :secondary_service_contact,
type: :object,
properties: {
uid: { type: :keyword },
email: { type: :text },
given_name: { type: :text },
family_name: { type: :text },
name: { type: :text },
}
indexes :voting_contact,
type: :object,
properties: {
uid: { type: :keyword },
email: { type: :text },
given_name: { type: :text },
family_name: { type: :text },
name: { type: :text },
}
indexes :created, type: :date
indexes :updated, type: :date
Expand Down

0 comments on commit 11bbc56

Please sign in to comment.