Skip to content

Commit

Permalink
Merge branch 'master' into ndbex-71275-pdf-stamping
Browse files Browse the repository at this point in the history
  • Loading branch information
evansmith authored Mar 26, 2024
2 parents c9f35ef + de101d0 commit eb439d3
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 31 deletions.
4 changes: 0 additions & 4 deletions config/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1020,10 +1020,6 @@ features:
actor_type: user
description: Allows veterans to cancel VA appointments
enable_in_development: true
va_online_scheduling_clinic_filtering:
actor_type: user
description: Allows clinic selection filtering by stop codes
enable_in_development: true
va_online_scheduling_community_care:
actor_type: user
description: Allows veterans to submit requests for Community Care appointments
Expand Down
15 changes: 14 additions & 1 deletion lib/decision_review/utilities/pdf_validation/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module DecisionReview
module PdfValidation
class Configuration < DecisionReview::Configuration
##
# @return [String] Base path for decision review URLs.
# @return [String] Base path for PDF validation URL.
#
def base_path
Settings.decision_review.pdf_validation.url
Expand All @@ -17,6 +17,19 @@ def service_name
'DecisionReview::PDFValidation'
end

##
# @return [Hash] The basic headers required for any decision review API call.
#
def self.base_request_headers
# Can use regular Decision Reviews API key in lower environments
return super unless Rails.env.production?

# Since we're using the `uploads/validate_document` endpoint under Benefits Intake API,
# we need to use their API key. This is pulled from BenefitsIntakeService::Configuration
api_key = Settings.benefits_intake_service.api_key || Settings.form526_backup.api_key
super.merge('apiKey' => api_key)
end

##
# Creates the a connection with parsing json and adding breakers functionality.
#
Expand Down
5 changes: 4 additions & 1 deletion modules/claims_api/lib/bgs_service/local_bgs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ def self.breakers_service
url = Settings.bgs.url
path = URI.parse(url).path
host = URI.parse(url).host
port = URI.parse(url).port
matcher = proc do |request_env|
request_env.url.host == host && request_env.url.path =~ /^#{path}/
request_env.url.host == host &&
request_env.url.port == port &&
request_env.url.path =~ /^#{path}/
end

Breakers::Service.new(
Expand Down
Binary file modified modules/claims_api/spec/fixtures/test_client.p12
Binary file not shown.
8 changes: 2 additions & 6 deletions modules/vaos/app/services/vaos/v2/systems_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
module VAOS
module V2
class SystemsService < VAOS::SessionService
STOP_CODE_FILTERS = :va_online_scheduling_clinic_filtering

def get_facility_clinics(location_id:,
clinical_service: nil,
clinic_ids: nil,
Expand All @@ -21,11 +19,9 @@ def get_facility_clinics(location_id:,
'pageNumber' => page_number
}.compact

# 'clinicalService' is used to retrieve clinics for appointment scheduling,
# 'clinicalService' is used when retrieving clinics for appointment scheduling,
# triggering stop code filtering to avoid displaying unavailable clinics.
if url_params['clinicalService'].present? && Flipper.enabled?(STOP_CODE_FILTERS, user)
url_params.merge!('enableStopCodeFilter' => true)
end
url_params.merge!('enableStopCodeFilter' => true) if url_params['clinicalService'].present?

response = perform(:get, url, url_params, headers)
response.body[:data].map { |clinic| OpenStruct.new(clinic) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class UploadProcessor
sidekiq_options unique_for: 30.days

def perform(guid, caller_data, retries = 0)
return if cancelled?

response = nil
brt = Benchmark.realtime do
# @retries variable used via the CentralMail::Utilities which is included via VBADocuments::UploadValidations
Expand All @@ -46,20 +44,6 @@ def perform(guid, caller_data, retries = 0)
response&.success? ? true : false
end

def cancelled?
Sidekiq.redis do |c|
if c.respond_to? :exists?
c.exists?("cancelled-#{jid}")
else
c.exists("cancelled-#{jid}")
end
end
end

def self.cancel!(jid)
Sidekiq.redis { |c| c.setex("cancelled-#{jid}", 86_400, 1) }
end

private

# rubocop:disable Metrics/MethodLength
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
@md = JSON.parse(valid_metadata)
@upload_submission = VBADocuments::UploadSubmission.new
@upload_submission.update(status: 'uploaded')
allow_any_instance_of(VBADocuments::UploadProcessor).to receive(:cancelled?).and_return(false)
allow_any_instance_of(Tempfile).to receive(:size).and_return(1) # must be > 0 or submission will error w/DOC107
allow(VBADocuments::MultipartParser).to receive(:parse) {
{ 'metadata' => @md.to_json, 'content' => valid_doc }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@
@md = JSON.parse(valid_metadata)
@upload_submission = VBADocuments::UploadSubmission.new
@upload_submission.update(status: 'uploaded')
allow_any_instance_of(VBADocuments::UploadProcessor).to receive(:cancelled?).and_return(false)
allow_any_instance_of(Tempfile).to receive(:size).and_return(1) # must be > 0 or submission will error w/DOC107
allow(VBADocuments::MultipartParser).to receive(:parse) {
{ 'metadata' => @md.to_json, 'content' => valid_doc }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
end

before do
allow_any_instance_of(described_class).to receive(:cancelled?).and_return(false)
allow_any_instance_of(Tempfile).to receive(:size).and_return(1) # must be > 0 or submission will error w/DOC107
objstore = instance_double(VBADocuments::ObjectStore)
version = instance_double(Aws::S3::ObjectVersion)
Expand Down

0 comments on commit eb439d3

Please sign in to comment.