Skip to content

Commit dd75cd7

Browse files
Removed extra pciu migration flippers (#21108)
* Removed extra pciu migration flippers * fixed failing specs * fixed update spec * fixed mdot spec * fixed swagger spec * rubo and bgs service spec fixed * fixed form prefill spec
1 parent 33b9173 commit dd75cd7

File tree

62 files changed

+123
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+123
-302
lines changed

app/controllers/concerns/vet360/transactionable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def check_transaction_status!
2323
private
2424

2525
def service
26-
if Flipper.enabled?(:va_v3_contact_information_service, @current_user)
26+
if Flipper.enabled?(:remove_pciu, @current_user)
2727
VAProfile::V2::ContactInformation::Service.new @current_user
2828
else
2929
VAProfile::ContactInformation::Service.new @current_user

app/controllers/concerns/vet360/writeable.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def write_to_vet360_and_render_transaction!(type, params, http_verb: 'post')
2727
end
2828

2929
def invalidate_cache
30-
if Flipper.enabled?(:va_v3_contact_information_service, @current_user)
30+
if Flipper.enabled?(:remove_pciu, @current_user)
3131
VAProfileRedis::V2::Cache.invalidate(@current_user)
3232
else
3333
VAProfileRedis::Cache.invalidate(@current_user)
@@ -38,7 +38,7 @@ def invalidate_cache
3838

3939
def build_record(type, params)
4040
# This needs to be refactored after V2 upgrade is complete
41-
if type == 'address' && Flipper.enabled?(:va_v3_contact_information_service, @current_user)
41+
if type == 'address' && Flipper.enabled?(:remove_pciu, @current_user)
4242
model = 'VAProfile::Models::V3::Address'
4343
# Ensures the address_pou is valid
4444
params[:address_pou] = 'RESIDENCE' if params[:address_pou] == 'RESIDENCE/CHOICE'
@@ -61,7 +61,7 @@ def validate!(record)
6161
end
6262

6363
def service
64-
if Flipper.enabled?(:va_v3_contact_information_service, @current_user)
64+
if Flipper.enabled?(:remove_pciu, @current_user)
6565
VAProfile::V2::ContactInformation::Service.new @current_user
6666
else
6767
VAProfile::ContactInformation::Service.new @current_user

app/controllers/v0/profile/address_validation_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AddressValidationController < ApplicationController
1313
skip_before_action :authenticate, only: [:create]
1414

1515
def create
16-
address = if Flipper.enabled?(:va_v3_contact_information_service)
16+
address = if Flipper.enabled?(:remove_pciu)
1717
VAProfile::Models::V3::ValidationAddress.new(address_params)
1818
else
1919
VAProfile::Models::ValidationAddress.new(address_params)
@@ -49,7 +49,7 @@ def address_params
4949
end
5050

5151
def service
52-
@service ||= if Flipper.enabled?(:va_v3_contact_information_service)
52+
@service ||= if Flipper.enabled?(:remove_pciu)
5353
VAProfile::V3::AddressValidation::Service.new
5454
else
5555
VAProfile::AddressValidation::Service.new

app/controllers/v0/profile/persons_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class PersonsController < ApplicationController
1212
after_action :invalidate_mpi_cache
1313

1414
def initialize_vet360_id
15-
response = if Flipper.enabled?(:va_v3_contact_information_service, @current_user)
15+
response = if Flipper.enabled?(:remove_pciu, @current_user)
1616
VAProfile::V2::Person::Service.new(@current_user).init_vet360_id
1717
else
1818
VAProfile::Person::Service.new(@current_user).init_vet360_id

app/controllers/v0/profile/transactions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def transaction_params
2929
end
3030

3131
def service
32-
if Flipper.enabled?(:va_v3_contact_information_service, @current_user)
32+
if Flipper.enabled?(:remove_pciu, @current_user)
3333
VAProfile::V2::ContactInformation::Service.new @current_user
3434
else
3535
VAProfile::ContactInformation::Service.new @current_user

app/controllers/v0/veteran_readiness_employment_claims_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def encrypted_user
4646
uuid: current_user.uuid,
4747
icn: current_user.icn,
4848
first_name: current_user.first_name,
49-
va_profile_email: current_user.va_profile_email || current_user.va_profile_v2_email
49+
va_profile_email: current_user.va_profile_email
5050
)
5151
KmsEncrypted::Box.new.encrypt(user_struct.to_h.to_json)
5252
end

app/models/async_transaction/va_profile/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def self.last_requested_for_user(user)
4343
#
4444
def self.start(user, response)
4545
# vet360_id is no longer required for Contact Information API V2
46-
source_id = if Flipper.enabled?(:va_v3_contact_information_service,
46+
source_id = if Flipper.enabled?(:remove_pciu,
4747
user)
4848
user.vet360_id || user.uuid
4949
else

app/models/form_profiles/va_21686c.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def metadata
108108
end
109109

110110
def prefill
111-
if Flipper.enabled?(:va_v3_contact_information_service, user)
111+
if Flipper.enabled?(:remove_pciu, user)
112112
return {} unless user.authorize :va_profile, :access_to_v2?
113113
else
114114
return {} unless user.authorize :evss, :access?

app/models/form_profiles/va_526ez.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def initialize_vets360_contact_info
186186
end
187187

188188
def initialize_veteran_contact_information
189-
if Flipper.enabled?(:disability_compensation_remove_pciu, user)
189+
if Flipper.enabled?(:remove_pciu, user)
190190
return {} unless user.authorize :va_profile, :access_to_v2?
191191

192192
contact_info = initialize_vets360_contact_info
@@ -202,11 +202,10 @@ def initialize_veteran_contact_information
202202
end
203203
# Logging was added below to contrast/compare completeness of contact information returned
204204
# from VA Profile alone versus VA Profile + PCIU. This logging will be removed when the Flipper flag is.
205-
Rails.logger.info("disability_compensation_remove_pciu=#{Flipper.enabled?(:disability_compensation_remove_pciu,
206-
user)}," \
207-
"mailing_address=#{contact_info[:mailing_address].present?}," \
208-
"email_address=#{contact_info[:email_address].present?}," \
209-
"primary_phone=#{contact_info[:primary_phone].present?}")
205+
Rails.logger.info("remove_pciu=#{Flipper.enabled?(:remove_pciu, user)}," \
206+
"mailing_address=#{contact_info[:mailing_address].present?}," \
207+
"email_address=#{contact_info[:email_address].present?}," \
208+
"primary_phone=#{contact_info[:primary_phone].present?}")
210209

211210
contact_info = VA526ez::FormContactInformation.new(contact_info)
212211

app/models/user.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,15 @@ def onboarding
410410
delegate :show_onboarding_flow_on_login, to: :onboarding, allow_nil: true
411411

412412
def vet360_contact_info
413-
return nil unless VAProfile::Configuration::SETTINGS.contact_information.enabled && vet360_id.present?
413+
return nil unless VAProfile::Configuration::SETTINGS.contact_information.enabled &&
414+
(
415+
(!Flipper.enabled?(:remove_pciu, self) && vet360_id.present?) ||
416+
(Flipper.enabled?(:remove_pciu, self) && icn.present?)
417+
)
414418

415-
@vet360_contact_info ||= if Flipper.enabled?(:remove_pciu, self)
419+
@vet360_contact_info ||= if Flipper.enabled?(:remove_pciu, self) && icn.present?
416420
VAProfileRedis::V2::ContactInformation.for_user(self)
417-
else
421+
elsif !Flipper.enabled?(:remove_pciu, self) && vet360_id.present?
418422
VAProfileRedis::ContactInformation.for_user(self)
419423
end
420424
end

0 commit comments

Comments
 (0)