Skip to content

Commit

Permalink
Merge branch 'master' into burial-90229-refactor-centralmail
Browse files Browse the repository at this point in the history
  • Loading branch information
wayne-weibel authored Nov 18, 2024
2 parents 178a5ed + 3ce75e9 commit 324b769
Show file tree
Hide file tree
Showing 116 changed files with 2,685 additions and 2,382 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ app/controllers/concerns/traceable.rb @department-of-veterans-affairs/va-api-eng
app/controllers/concerns/vet360 @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/flipper_controller.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/gids_controller.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v0/banners_controller.rb @department-of-veterans-affairs/vfs-facilities-frontend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v0/income_and_assets_claims_controller.rb @department-of-veterans-affairs/pension-and-burials @department-of-veterans-affairs/backend-review-group
app/controllers/preneeds_controller.rb @department-of-veterans-affairs/mbs-core-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/rx_controller.rb @department-of-veterans-affairs/vfs-mhv-medications @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -165,7 +166,6 @@ app/controllers/v1/decision_review_evidences_controller.rb @department-of-vetera
app/controllers/v1/decision_review_notification_callbacks_controller.rb @department-of-veterans-affairs/benefits-decision-reviews-be @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v1/apidocs_controller.rb @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v1/notice_of_disagreements_controller.rb @department-of-veterans-affairs/benefits-decision-reviews-be @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/controllers/v1/pension_ipf_callbacks_controller.rb @department-of-veterans-affairs/pension-and-burials @department-of-veterans-affairs/backend-review-group
app/controllers/v1/sessions_controller.rb @department-of-veterans-affairs/octo-identity
app/controllers/v1/supplemental_claims_controller.rb @department-of-veterans-affairs/benefits-decision-reviews-be @department-of-veterans-affairs/backend-review-group
app/controllers/v1/supplemental_claims @department-of-veterans-affairs/benefits-decision-reviews-be @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -695,7 +695,6 @@ config/form_profile_mappings/20-0996.yml @department-of-veterans-affairs/benefit
config/form_profile_mappings/21-526EZ.yml @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
config/form_profile_mappings/21-686C.yml @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
config/form_profile_mappings/21P-527EZ.yml @department-of-veterans-affairs/pension-and-burials @department-of-veterans-affairs/backend-review-group
config/form_profile_mappings/21P-527EZ-military.yml @department-of-veterans-affairs/pension-and-burials @department-of-veterans-affairs/backend-review-group
config/form_profile_mappings/21P-0969.yml @department-of-veterans-affairs/pension-and-burials @department-of-veterans-affairs/backend-review-group
config/form_profile_mappings/21P-530.yml @department-of-veterans-affairs/disability-experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
config/form_profile_mappings/21P-530V2.yml @department-of-veterans-affairs/disability-experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -1108,6 +1107,7 @@ spec/controllers/v0/benefits_reference_data_controller_spec.rb @department-of-ve
spec/controllers/v0/burial_claims_controller_spec.rb @department-of-veterans-affairs/mbs-core-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/caregivers_assistance_claims_controller_spec.rb @department-of-veterans-affairs/vfs-10-10
spec/controllers/v0/claim_letters_controller_spec.rb @department-of-veterans-affairs/benefits-management-tools-be @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/contact_us @department-of-veterans-affairs/ask-va-team @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/debt_letters_controller_spec.rb @department-of-veterans-affairs/vsa-debt-resolution @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/dependents_applications_controller_spec.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/controllers/v0/dependents_verifications_controller_spec.rb @department-of-veterans-affairs/benefits-dependents-management @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/be_review_prs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Require backend-review-group approval
on:
pull_request:
types: [opened, reopened, review_requested, synchronize, ready_for_review]
pull_request_review:
types: [submitted]

Expand Down
18 changes: 18 additions & 0 deletions app/controllers/v0/banners_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

module V0
class BannersController < ApplicationController
service_tag 'banners'
skip_before_action :authenticate

def by_path
path = params[:path]
# Default to 'full_width_banner_alert' banner (bundle) type.
banner_type = params.fetch(:type, 'full_width_banner_alert')
banners = []
banners = Banner.by_path_and_type(path, banner_type) if path && banner_type
response = { banners: banners, path: path, banner_type: banner_type }
render json: response
end
end
end
6 changes: 6 additions & 0 deletions app/controllers/v0/health_care_applications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ class HealthCareApplicationsController < ApplicationController
before_action(only: :rating_info) { authorize(:hca_disability_rating, :access?) }

def rating_info
if Flipper.enabled?(:hca_disable_bgs_service)
# Return 0 when not calling the actual BGS::Service
render json: HCARatingInfoSerializer.new({ user_percent_of_disability: 0 })
return
end

service = BGS::Service.new(current_user)
disability_rating = service.find_rating_data[:disability_rating_record][:service_connected_combined_degree]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def encrypted_user
loa3?: current_user.loa3?,
uuid: current_user.uuid,
icn: current_user.icn,
first_name: current_user.first_name,
va_profile_email: current_user.va_profile_email || current_user.va_profile_v2_email
)
KmsEncrypted::Box.new.encrypt(user_struct.to_h.to_json)
Expand Down
79 changes: 0 additions & 79 deletions app/controllers/v1/pension_ipf_callbacks_controller.rb

This file was deleted.

25 changes: 14 additions & 11 deletions app/controllers/v1/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ def authenticate
def user_login(saml_response)
user_session_form = UserSessionForm.new(saml_response)
raise_saml_error(user_session_form) unless user_session_form.valid?
mhv_unverified_validation(user_session_form)

mhv_unverified_validation(user_session_form.user)
create_user_verification(user_session_form.user)
@current_user, @session_object = user_session_form.persist
set_cookies
after_login_actions
Expand All @@ -158,8 +158,18 @@ def user_login(saml_response)
login_stats(:success)
end

def mhv_unverified_validation(user_session_form)
if html_escaped_relay_state['type'] == 'mhv_verified' && user_session_form.user.loa[:current] < LOA::THREE
def create_user_verification(user)
user_verifier_object = OpenStruct.new({ sign_in: user.identity.sign_in,
mhv_correlation_id: user.mhv_correlation_id,
idme_uuid: user.idme_uuid,
edipi: user.identity.edipi,
logingov_uuid: user.logingov_uuid,
icn: user.icn })
Login::UserVerifier.new(user_verifier_object).perform
end

def mhv_unverified_validation(user)
if html_escaped_relay_state['type'] == 'mhv_verified' && user.loa[:current] < LOA::THREE
mhv_unverified_error = SAML::UserAttributeError::ERRORS[:mhv_unverified_blocked]
Rails.logger.warn("SessionsController version:v1 #{mhv_unverified_error[:message]}")
raise SAML::UserAttributeError.new(message: mhv_unverified_error[:message],
Expand Down Expand Up @@ -398,13 +408,6 @@ def set_cookies
end

def after_login_actions
user_verifier_object = OpenStruct.new({ sign_in: @current_user.identity.sign_in,
mhv_correlation_id: @current_user.mhv_correlation_id,
idme_uuid: @current_user.idme_uuid,
edipi: @current_user.identity.edipi,
logingov_uuid: @current_user.logingov_uuid,
icn: @current_user.icn })
Login::UserVerifier.new(user_verifier_object).perform
Login::AfterLoginActions.new(@current_user).perform
log_persisted_session_and_warnings
end
Expand Down
2 changes: 0 additions & 2 deletions app/models/form_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ def metadata

def self.mappings_for_form(form_id)
@mappings ||= {}
# temporarily using a different mapping for 21P-527EZ to keep the change behind the pension_military_prefill flag
form_id = '21P-527EZ-military' if form_id == '21P-527EZ' && Flipper.enabled?(:pension_military_prefill, @user)
@mappings[form_id] || (@mappings[form_id] = load_form_mapping(form_id))
end

Expand Down
8 changes: 2 additions & 6 deletions app/models/form_profiles/va_21p527ez.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ def metadata
}
end

# overrides FormProfile#initialize_military_information (when pension_military_prefill
# flag is enabled) to use Pension21p527ez::PensionFormMilitaryInformation instead of
# overrides FormProfile#initialize_military_information
# to use Pension21p527ez::PensionFormMilitaryInformation instead of
# FormProfile::FormMilitaryInformation in order to add additional military information fields.
# @see lib/pension_21p527ez/pension_military_information.rb PensionFormMilitaryInformation
# @see lib/va_profile/prefill/military_information.rb FormMilitaryInformation
def initialize_military_information
return super unless Flipper.enabled?(:pension_military_prefill, @user)
return {} unless user.authorize :va_profile, :access?

military_information_data = {}
Expand All @@ -30,14 +29,11 @@ def initialize_military_information
private

# overrides FormProfile#initialize_va_profile_prefill_military_information
# (when pension_military_prefill flag is enabled) to use
# Pension21p527ez::PensionMilitaryInformation instead of
# FormProfile::MilitaryInformation in order to add additional military information fields.
# @see lib/pension_21p527ez/pension_military_information.rb PensionMilitaryInformation
# @see lib/va_profile/prefill/military_information.rb MilitaryInformation
def initialize_va_profile_prefill_military_information
return super unless Flipper.enabled?(:pension_military_prefill, @user)

military_information_data = {}
military_information = Pension21p527ez::PensionMilitaryInformation.new(user)

Expand Down
20 changes: 0 additions & 20 deletions app/models/pension_ipf_notification.rb

This file was deleted.

12 changes: 7 additions & 5 deletions app/models/saved_claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ def form_matches_schema
return unless form_is_string

schema = VetsJsonSchema::SCHEMAS[self.class::FORM]
clear_cache = false

schema_errors = validate_schema(schema)
unless Flipper.enabled?(:saved_claim_schema_validation_disable)
schema_errors = validate_schema(schema)

clear_cache = false
unless schema_errors.empty?
Rails.logger.error('SavedClaim schema failed validation! Attempting to clear cache.', { errors: schema_errors })
clear_cache = true
unless schema_errors.empty?
Rails.logger.error('SavedClaim schema failed validation! Attempting to clear cache.', { errors: schema_errors })
clear_cache = true
end
end

validation_errors = validate_form(schema, clear_cache)
Expand Down
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ def needs_accepted_terms_of_use
end

def user_verification
@user_verification ||= get_user_verification
@user_verification ||= UserVerification.find_by(id: user_verification_id)
end

def user_account
@user_account ||= user_verification&.user_account
end

def user_verification_id
@user_verification_id ||= user_verification&.id
@user_verification_id ||= get_user_verification&.id
end

def user_account_uuid
Expand Down
25 changes: 22 additions & 3 deletions app/services/medical_copays/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,32 @@ def initialize
# @return [Faraday::Response]
#
def post(path, params)
with_monitoring do
connection.post(path) do |req|
req.body = Oj.dump(params)
if Flipper.enabled?(:debts_copay_logging) && !Rails.env.development?
with_monitoring_and_error_handling do
connection.post(path) do |req|
req.body = Oj.dump(params)
end
end
else
with_monitoring do
connection.post(path) do |req|
req.body = Oj.dump(params)
end
end
end
end

def with_monitoring_and_error_handling(&)
with_monitoring(2, &)
rescue => e
handle_error(e)
end

def handle_error(error)
Rails.logger.error("MedicalCopays::Request error: #{error.message}")
raise error
end

##
# Make a HTTP GET call to the VBS service in order to obtain copays or PDFs by id
#
Expand Down
4 changes: 4 additions & 0 deletions app/services/medical_copays/vbs/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ def get_pdf_statement_by_id(statement_id)
end

def get_copay_response
if Flipper.enabled?(:debts_copay_logging)
Rails.logger.info("MedicalCopays::VBS::Service#get_copay_response request data: #{@user.uuid}")
end

request.post("#{settings.base_path}/GetStatementsByEDIPIAndVistaAccountNumber", request_data.to_hash)
end

Expand Down
Loading

0 comments on commit 324b769

Please sign in to comment.