Skip to content

Commit

Permalink
Merge branch 'master' into 96412_merge_eps_appointments
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-delarm6 authored Jan 21, 2025
2 parents 2a333fd + bde30a1 commit 80347b3
Show file tree
Hide file tree
Showing 701 changed files with 9,382 additions and 9,957 deletions.
40 changes: 26 additions & 14 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

413 changes: 0 additions & 413 deletions .rubocop_todo.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ gem 'sign_in_service'
gem 'slack-notify'
gem 'socksify'
gem 'staccato'
gem 'statsd-instrument'
gem 'statsd-instrument', '3.9.8' # 3.9.9 breaking change - Address Family IPv6
gem 'strong_migrations'
gem 'swagger-blocks'
# Include the IANA Time Zone Database on Windows, where Windows doesn't ship with a timezone database.
Expand Down
46 changes: 23 additions & 23 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,23 @@ GEM
attr_extras (7.1.0)
awesome_print (1.9.2)
aws-eventstream (1.3.0)
aws-partitions (1.1031.0)
aws-sdk-core (3.214.1)
aws-partitions (1.1039.0)
aws-sdk-core (3.216.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.96.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (1.97.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.177.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-s3 (1.178.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sdk-sns (1.92.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-sns (1.93.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.1)
aws-sigv4 (1.11.0)
aws-eventstream (~> 1, >= 1.0.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
Expand Down Expand Up @@ -316,7 +316,7 @@ GEM
activesupport (>= 6.0)
committee (>= 5.1.0)
railties (>= 6.0)
concurrent-ruby (1.3.4)
concurrent-ruby (1.3.5)
config (5.5.2)
deep_merge (~> 1.2, >= 1.2.1)
ostruct
Expand Down Expand Up @@ -508,7 +508,7 @@ GEM
google-api-client (0.53.0)
google-apis-core (~> 0.1)
google-apis-generator (~> 0.1)
google-apis-core (0.15.1)
google-apis-core (0.16.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 1.9)
httpclient (>= 2.8.3, < 3.a)
Expand Down Expand Up @@ -584,7 +584,7 @@ GEM
mutex_m
nkf
rack (>= 2.0, < 4)
i18n (1.14.6)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
image_processing (1.13.0)
Expand Down Expand Up @@ -634,9 +634,9 @@ GEM
ffi (~> 1.0)
libddwaf (1.18.0.0.0-x86_64-linux)
ffi (~> 1.0)
liquid (5.6.0)
liquid (5.7.0)
bigdecimal
strscan
strscan (>= 3.1.1)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand Down Expand Up @@ -697,14 +697,14 @@ GEM
nio4r (2.7.4-java)
nkf (0.2.0)
nkf (0.2.0-java)
nokogiri (1.18.1)
nokogiri (1.18.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.18.1-aarch64-linux-gnu)
nokogiri (1.18.2-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.1-java)
nokogiri (1.18.2-java)
racc (~> 1.4)
nokogiri (1.18.1-x86_64-linux-gnu)
nokogiri (1.18.2-x86_64-linux-gnu)
racc (~> 1.4)
nori (2.7.1)
bigdecimal
Expand Down Expand Up @@ -744,7 +744,7 @@ GEM
parallel (1.26.3)
parallel_tests (4.9.0)
parallel
parser (3.3.6.0)
parser (3.3.7.0)
ast (~> 2.4.1)
racc
patience_diff (1.2.0)
Expand Down Expand Up @@ -964,12 +964,12 @@ GEM
rubocop-factory_bot (2.26.1)
rubocop (~> 1.61)
rubocop-junit-formatter (0.1.4)
rubocop-rails (2.28.0)
rubocop-rails (2.29.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.3.0)
rubocop-rspec (3.4.0)
rubocop (~> 1.61)
rubocop-rspec_rails (2.30.0)
rubocop (~> 1.61)
Expand Down Expand Up @@ -1049,7 +1049,7 @@ GEM
ffi
ssrf_filter (1.2.0)
staccato (0.5.3)
statsd-instrument (3.9.9)
statsd-instrument (3.9.8)
stringio (3.1.2)
strong_migrations (2.1.0)
activerecord (>= 6.1)
Expand Down Expand Up @@ -1322,7 +1322,7 @@ DEPENDENCIES
slack-notify
socksify
staccato
statsd-instrument
statsd-instrument (= 3.9.8)
strong_migrations
super_diff
swagger-blocks
Expand Down
8 changes: 8 additions & 0 deletions app/controllers/appeals_base_controller_v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ class AppealsBaseControllerV1 < ApplicationController

private

def log_non_module_controller(action:, form_id:)
Rails.logger.warn({
message: 'Calling decision reviews controller outside module',
action:,
form_id:
})
end

def decision_review_service
DecisionReviewV1::Service.new
end
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/claims_base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class ClaimsBaseController < ApplicationController
skip_before_action(:authenticate)
before_action :load_user, only: :create

def show
submission = CentralMailSubmission.joins(:central_mail_claim).find_by(saved_claims: { guid: params[:id] })
render json: BenefitsIntakeSubmissionSerializer.new(submission)
end

# Creates and validates an instance of the class, removing any copies of
# the form that had been previously saved by the user.
def create
Expand All @@ -39,11 +44,6 @@ def create
render json: SavedClaimSerializer.new(claim)
end

def show
submission = CentralMailSubmission.joins(:central_mail_claim).find_by(saved_claims: { guid: params[:id] })
render json: BenefitsIntakeSubmissionSerializer.new(submission)
end

private

def filtered_params
Expand Down
12 changes: 12 additions & 0 deletions app/controllers/concerns/datadog_logging.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module DatadogLogging
extend ActiveSupport::Concern

def log_to_datadog(context, message, stack_trace)
if Flipper.enabled?(:virtual_agent_enable_datadog_logging, current_user)
error_details = { message: message, backtrace: stack_trace }
Rails.logger.error(context, error_details)
end
end
end
5 changes: 5 additions & 0 deletions app/controllers/v0/apidocs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ class ApidocsController < ApplicationController
key :name, 'medical_copays'
key :description, 'Veteran Medical Copay information for VA facilities'
end
tag do
key :name, 'Banners'
key :description, 'VAMC Situation Update Banners'
end
key :host, Settings.hostname
key :schemes, %w[https http]
key :basePath, '/'
Expand Down Expand Up @@ -120,6 +124,7 @@ class ApidocsController < ApplicationController
Swagger::Requests::Appointments,
Swagger::Requests::ContactUs::Inquiries,
Swagger::Requests::BackendStatuses,
Swagger::Requests::Banners,
Swagger::Requests::BB::HealthRecords,
Swagger::Requests::BurialClaims,
Swagger::Requests::BenefitsReferenceData,
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/v0/claim_documents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def create
# add the file after so that we have a form_id and guid for the uploader to use
@attachment.file = unlock_file(params['file'], params['password'])

if %w[21P-527EZ 21P-530 21P-530V2].include?(form_id) &&
if %w[21P-527EZ 21P-530EZ 21P-530V2].include?(form_id) &&
Flipper.enabled?(:document_upload_validation_enabled) && !stamped_pdf_valid?

raise Common::Exceptions::ValidationErrors, @attachment
Expand Down
2 changes: 0 additions & 2 deletions app/controllers/v0/contact_us/inquiries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ def create

def form_submission
params.require(:inquiry).require(:form)
rescue
raise
end

def validate!(claim)
Expand Down
18 changes: 9 additions & 9 deletions app/controllers/v0/dependents_applications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ module V0
class DependentsApplicationsController < ApplicationController
service_tag 'dependent-change'

def show
dependents = dependent_service.get_dependents
dependents[:diaries] = dependency_verification_service.read_diaries
render json: DependentsSerializer.new(dependents)
rescue => e
log_exception_to_sentry(e)
raise Common::Exceptions::BackendServiceException.new(nil, detail: e.message)
end

def create
claim = SavedClaim::DependencyClaim.new(form: dependent_params.to_json)

Expand All @@ -22,15 +31,6 @@ def create
render json: SavedClaimSerializer.new(claim)
end

def show
dependents = dependent_service.get_dependents
dependents[:diaries] = dependency_verification_service.read_diaries
render json: DependentsSerializer.new(dependents)
rescue => e
log_exception_to_sentry(e)
raise Common::Exceptions::BackendServiceException.new(nil, detail: e.message)
end

def disability_rating
res = EVSS::Dependents::RetrievedInfo.for_user(current_user)
render json: { has30_percent: res.body.dig('submitProcess', 'application', 'has30Percent') }
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/v0/gi_bill_feedbacks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ class GIBillFeedbacksController < ApplicationController
skip_before_action(:authenticate)
before_action :load_user, only: :create

def show
gi_bill_feedback = GIBillFeedback.find(params[:id])
render json: GIBillFeedbackSerializer.new(gi_bill_feedback)
end

def create
gi_bill_feedback = GIBillFeedback.new(
params.require(:gi_bill_feedback).permit(:form).merge(
Expand All @@ -23,10 +28,5 @@ def create

render json: GIBillFeedbackSerializer.new(gi_bill_feedback)
end

def show
gi_bill_feedback = GIBillFeedback.find(params[:id])
render json: GIBillFeedbackSerializer.new(gi_bill_feedback)
end
end
end
10 changes: 5 additions & 5 deletions app/controllers/v0/health_care_applications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ def rating_info
render json: HCARatingInfoSerializer.new(hca_rating_info)
end

def show
application = HealthCareApplication.find(params[:id])
render json: HealthCareApplicationSerializer.new(application)
end

def create
health_care_application.async_compatible = params[:async_all]
health_care_application.google_analytics_client_id = params[:ga_client_id]
Expand All @@ -52,11 +57,6 @@ def create
end
end

def show
application = HealthCareApplication.find(params[:id])
render json: HealthCareApplicationSerializer.new(application)
end

def enrollment_status
loa3 = current_user&.loa3?

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/v0/map_services_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def token
result = MAP::SecurityToken::Service.new.token(application: params[:application].to_sym, icn:, cache: false)

render json: result, status: :ok
rescue Common::Client::Errors::ClientError, Common::Exceptions::GatewayTimeout
rescue Common::Client::Errors::ClientError, Common::Exceptions::GatewayTimeout, JWT::DecodeError
render json: sts_client_error, status: :bad_gateway
rescue MAP::SecurityToken::Errors::ApplicationMismatchError
render json: application_mismatch_error, status: :bad_request
Expand Down
20 changes: 10 additions & 10 deletions app/controllers/v0/onsite_notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ def index
render json: OnsiteNotificationSerializer.new(notifications, options)
end

def create
onsite_notification = OnsiteNotification.new(
params.require(:onsite_notification).permit(:va_profile_id, :template_id)
)

raise Common::Exceptions::ValidationErrors, onsite_notification unless onsite_notification.save

render json: OnsiteNotificationSerializer.new(onsite_notification)
end

def update
onsite_notification = OnsiteNotification.find_by(id: params[:id], va_profile_id: current_user.vet360_id)
raise Common::Exceptions::RecordNotFound, params[:id] if onsite_notification.nil?
Expand All @@ -32,16 +42,6 @@ def update
render json: OnsiteNotificationSerializer.new(onsite_notification)
end

def create
onsite_notification = OnsiteNotification.new(
params.require(:onsite_notification).permit(:va_profile_id, :template_id)
)

raise Common::Exceptions::ValidationErrors, onsite_notification unless onsite_notification.save

render json: OnsiteNotificationSerializer.new(onsite_notification)
end

private

def authenticity_error
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/v0/profile/address_validation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def create
VAProfile::Models::ValidationAddress.new(address_params)
end

Rails.logger.info("Staging Address valid: #{address.valid?}") if Settings.vsp_environment == 'staging'

raise Common::Exceptions::ValidationErrors, address unless address.valid?

Rails.logger.warn('AddressValidationController#create request completed', sso_logging_info)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# frozen_string_literal: true

require 'date'
require 'datadog_logging'

module V0
module VirtualAgent
class VirtualAgentAppealController < AppealsBaseController
include DatadogLogging
service_tag 'virtual-agent'

def index
Expand Down Expand Up @@ -165,6 +167,8 @@ def get_status_type_text(appeal_status, aoj)
appeal_status_description = 'Unknown Status'
unknown_status_error = StandardError.new("Unknown status: #{appeal_status} with AOJ: #{aoj}")
log_exception_to_sentry(unknown_status_error, { appeal_status => appeal_status, aoj => aoj })
log_to_datadog(appeal_status_description, unknown_status_error.message,
unknown_status_error.backtrace)
end

if appeal_status_description.include? '{aoj_desc}'
Expand Down Expand Up @@ -192,6 +196,7 @@ def set_user_credentials
def service_exception_handler(exception)
context = 'An error occurred while attempting to retrieve the appeal(s)'
log_exception_to_sentry(exception, 'context' => context)
log_to_datadog(context, exception.message, exception.backtrace)
render nothing: true, status: :internal_server_error
end
end
Expand Down
Loading

0 comments on commit 80347b3

Please sign in to comment.