Skip to content

Commit

Permalink
Merge branch 'master' into 94285-refactor-log-email-diff-job
Browse files Browse the repository at this point in the history
  • Loading branch information
coope93 committed Nov 15, 2024
2 parents 66bcf82 + cfb155c commit 7a19608
Show file tree
Hide file tree
Showing 30 changed files with 249 additions and 273 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,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
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ gem 'connect_vbms', git: 'https://github.com/adhocteam/connect_vbms', tag: 'v2.1
gem 'csv'
gem 'date_validator'
gem 'ddtrace'
gem 'dogstatsd-ruby', '5.6.2'
gem 'dogstatsd-ruby', '5.6.3'
gem 'dry-struct'
gem 'dry-types'
gem 'ethon', '>=0.13.0'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ GEM
thread_safe (~> 0.3, >= 0.3.1)
diff-lcs (1.5.1)
docile (1.4.0)
dogstatsd-ruby (5.6.2)
dogstatsd-ruby (5.6.3)
domain_name (0.6.20240107)
down (5.4.2)
addressable (~> 2.8)
Expand Down Expand Up @@ -1162,7 +1162,7 @@ DEPENDENCIES
ddtrace
debts_api!
dhp_connected_devices!
dogstatsd-ruby (= 5.6.2)
dogstatsd-ruby (= 5.6.3)
dry-struct
dry-types
ethon (>= 0.13.0)
Expand Down
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
79 changes: 0 additions & 79 deletions app/controllers/v1/pension_ipf_callbacks_controller.rb

This file was deleted.

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

This file was deleted.

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
2 changes: 1 addition & 1 deletion app/sidekiq/benefits_intake_status_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def monitor_failure(form_id, saved_claim_id, bi_uuid)
if %w[28-1900].include?(form_id)
claim = SavedClaim::VeteranReadinessEmploymentClaim.find(saved_claim_id)
if claim
claim.submit_failure_email
claim.send_failure_email
VRE::Monitor.new.log_silent_failure_avoided(context, nil, call_location:)
else
VRE::Monitor.new.log_silent_failure(context, nil, call_location:)
Expand Down
13 changes: 9 additions & 4 deletions config/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ features:
hca_browser_monitoring_enabled:
actor_type: user
description: Enables browser monitoring for the health care application.
hca_disable_bgs_service:
actor_type: user
description: Do not call the BGS Service when this is turned on. Instead return 0 for rating.
hca_enrollment_status_override_enabled:
actor_type: user
description: Enables override of enrollment status for a user, to allow multiple submissions with same user.
Expand Down Expand Up @@ -372,6 +375,9 @@ features:
debts_cache_vbs_copays_empty_response:
actor_type: user
description: Enables caching of empty VBS medical copay response
debts_copay_logging:
actor_type: user
description: Logs copay request data
decision_review_hlr_email:
actor_type: user
description: Send email notification for successful HLR submission
Expand Down Expand Up @@ -1151,6 +1157,9 @@ features:
my_va_form_submission_statuses:
actor_type: user
description: Enables users to view the status of submitted forms.
my_va_form_submission_pdf_link:
actor_type: user
description: Enables users to view PDF link within submitted forms cards
rated_disabilities_detect_discrepancies:
actor_type: user
description:
Expand Down Expand Up @@ -1690,10 +1699,6 @@ features:
actor_type: user
description: Supplemental Claim new form updates
enable_in_development: true
pension_ipf_callbacks_endpoint:
actor_type: user
description: Pension IPF VANotify notification callbacks endpoint
enable_in_development: true
hlr_browser_monitoring_enabled:
actor_type: user
description: HLR Datadog RUM monitoring
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@

scope format: false do
resources :nod_callbacks, only: [:create], controller: :decision_review_notification_callbacks
resources :pension_ipf_callbacks, only: [:create]
end
end

Expand Down
3 changes: 0 additions & 3 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1792,9 +1792,6 @@ brd:
nod_vanotify_status_callback:
bearer_token: bearer_token_secret

pension_ipf_vanotify_status_callback:
bearer_token: bearer_token_secret

travel_pay:
sts:
service_account_id: ~
Expand Down
3 changes: 0 additions & 3 deletions config/settings/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,6 @@ travel_pay:
client_number: '12345'
service_name: 'BTSSS-API'

pension_ipf_vanotify_status_callback:
bearer_token: bearer_token_secret

va_notify:
status_callback:
bearer_token: 'va_notify_bearer_token'
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ class AddIndexToFormEmailMatchesProfileLogs < ActiveRecord::Migration[7.1]
disable_ddl_transaction!

def change
add_index :form_email_matches_profile_logs, [:user_uuid, :in_progress_form_id], unique: true, algorithm: :concurrently
add_index :form_email_matches_profile_logs,
%i[user_uuid in_progress_form_id],
unique: true,
algorithm: :concurrently,
if_not_exists: true
end
end
10 changes: 10 additions & 0 deletions modules/claims_api/app/models/claims_api/auto_established_claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def to_internal # rubocop:disable Metrics/MethodLength
resolve_homelessness_risk_situation_type_mappings!
transform_homelessness_point_of_contact_primary_phone!
transform_address_lines_length!
transform_empty_unit_name!

{
form526: form_data
Expand Down Expand Up @@ -533,5 +534,14 @@ def transform_address_lines_length!

form_data['veteran']['currentMailingAddress'] = addr
end

def transform_empty_unit_name!
reserves = form_data&.dig('serviceInformation', 'reservesNationalGuardService')
return if reserves.nil?

unit_name = reserves['unitName']
unit_name = unit_name.presence || ' '
reserves['unitName'] = unit_name
end
end
end
15 changes: 15 additions & 0 deletions modules/claims_api/spec/models/auto_establish_claim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,21 @@
end
end

describe '#transform_empty_unit_name!' do
let(:unit_name) { '' }

it 'trasforms an empty unit name to a space' do
temp_form_data = pending_record.form_data
temp_form_data['serviceInformation']['reservesNationalGuardService']['unitName'] = unit_name

pending_record.form_data = temp_form_data
payload = JSON.parse(pending_record.to_internal)
name = payload['form526']['serviceInformation']['reservesNationalGuardService']['unitName']

expect(name).to eq(' ')
end
end

describe 'evss_id_by_token' do
context 'with a record' do
let(:evss_record) { create(:auto_established_claim, evss_id: 123_456) }
Expand Down
Loading

0 comments on commit 7a19608

Please sign in to comment.