Skip to content

Commit

Permalink
Created flipper to omit PCIU data in form pre-fills
Browse files Browse the repository at this point in the history
  • Loading branch information
RachalCassity committed Dec 20, 2024
1 parent f7b06a8 commit 0e0232b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
12 changes: 7 additions & 5 deletions app/models/form_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,13 @@ def initialize_contact_information
Rails.logger.info("User Vet360 Contact Info, Address? #{opt[:address].present?}
Email? #{opt[:email].present?}, Phone? #{opt[:home_phone].present?}")

opt[:address] ||= user_address_hash
opt[:email] ||= extract_pciu_data(:pciu_email)
if opt[:home_phone].nil?
opt[:home_phone] = pciu_primary_phone
opt[:us_phone] = pciu_us_phone
unless Flipper.enabled?('remove_pciu_2', user)
opt[:address] ||= user_address_hash
opt[:email] ||= extract_pciu_data(:pciu_email)
if opt[:home_phone].nil?
opt[:home_phone] = pciu_primary_phone
opt[:us_phone] = pciu_us_phone
end
end

format_for_schema_compatibility(opt)
Expand Down
7 changes: 5 additions & 2 deletions config/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,10 @@ features:
enabled_in_development: true
remove_pciu:
actor_type: user
description: If enabled, VA Profile is used to populate contact information- without PCIU calls (status quo)
description: If enabled, VA Profile is used to populate contact information with PCIU backup calls
remove_pciu_2:
actor_type: user
description: If enabled, removes all PCIU requests in form pre-fill.
show_yellow_ribbon_table:
actor_type: user
description: Used to show yellow ribbon table in Comparison Tool
Expand Down Expand Up @@ -1978,4 +1981,4 @@ features:
is_updated_gi:
actor_type: user
description: If enabled, use updated gi design

3 changes: 3 additions & 0 deletions spec/models/form_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
before do
stub_evss_pciu(user)
described_class.instance_variable_set(:@mappings, nil)
Flipper.disable(:va_v3_contact_information_service)
Flipper.disable(:remove_pciu)
Flipper.disable('remove_pciu_2')
Flipper.disable(:disability_526_toxic_exposure)
Flipper.disable(ApiProviderFactory::FEATURE_TOGGLE_PPIU_DIRECT_DEPOSIT)
end
Expand Down

0 comments on commit 0e0232b

Please sign in to comment.