Skip to content

Commit

Permalink
Merge branch 'master' into tdc/appoint-poa-dependent-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
tycol7 authored Oct 7, 2024
2 parents 86d3cbb + f703394 commit c16cec5
Show file tree
Hide file tree
Showing 81 changed files with 2,711 additions and 541 deletions.
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ GEM
attr_extras (7.1.0)
awesome_print (1.9.2)
aws-eventstream (1.3.0)
aws-partitions (1.983.0)
aws-partitions (1.984.0)
aws-sdk-core (3.209.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand All @@ -256,8 +256,8 @@ GEM
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sdk-sns (1.85.0)
aws-sdk-core (~> 3, >= 3.205.0)
aws-sdk-sns (1.88.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.0)
aws-eventstream (~> 1, >= 1.0.2)
Expand Down Expand Up @@ -466,9 +466,9 @@ GEM
flipper-active_record (1.3.1)
activerecord (>= 4.2, < 8)
flipper (~> 1.3.1)
flipper-active_support_cache_store (1.3.0)
flipper-active_support_cache_store (1.3.1)
activesupport (>= 4.2, < 8)
flipper (~> 1.3.0)
flipper (~> 1.3.1)
flipper-ui (1.3.1)
erubi (>= 1.0.0, < 2.0.0)
flipper (~> 1.3.1)
Expand Down Expand Up @@ -600,7 +600,7 @@ GEM
jsonapi-serializer (2.2.0)
activesupport (>= 4.2)
jwe (0.4.0)
jwt (2.8.2)
jwt (2.9.3)
base64
kms_encrypted (1.6.0)
activesupport (>= 6.1)
Expand Down Expand Up @@ -1022,7 +1022,7 @@ GEM
stringio (3.1.1)
strong_migrations (2.0.0)
activerecord (>= 6.1)
super_diff (0.12.1)
super_diff (0.13.0)
attr_extras (>= 6.2.4)
diff-lcs
patience_diff
Expand Down
7 changes: 3 additions & 4 deletions app/controllers/v0/backend_statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def index
render json: BackendStatusesSerializer.new(backend_statuses, options)
end

# TO-DO: After transition of Post-911 GI Bill to 24/7 availability, confirm show action
# and related logic can be completely removed
#
# GET /v0/backend_statuses/:service
def show
render json: BackendStatusSerializer.new(backend_status)
Expand Down Expand Up @@ -46,9 +49,5 @@ def validate_service
def recognized_service?
BackendServices.all.include?(backend_service)
end

def backend_status_is_available
backend_service == BackendServices::GI_BILL_STATUS
end
end
end
1 change: 0 additions & 1 deletion app/controllers/v0/my_va/submission_statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module MyVA
class SubmissionStatusesController < ApplicationController
service_tag 'form-submission-statuses'
before_action :controller_enabled?
before_action { authorize :lighthouse, :access? }

def show
report = Forms::SubmissionStatuses::Report.new(
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/v0/profile/service_histories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_military_info
handle_errors!(response.episodes)
report_results(response.episodes)

service_history_json = JSON.parse(response.episodes.to_json, symbolize_names: true)
service_history_json = JSON.parse(response.to_json, symbolize_names: true)
options = { is_collection: false }

render json: ServiceHistorySerializer.new(service_history_json, options), status: response.status
Expand Down
5 changes: 4 additions & 1 deletion app/controllers/v1/post911_gi_bill_statuses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Post911GIBillStatusesController < ApplicationController
include SentryLogging
service_tag 'gibill-statement'

# TO-DO: Remove this action after transition of LTS to 24/7 availability
before_action :service_available?, only: :show

STATSD_GI_BILL_TOTAL_KEY = 'api.lighthouse.gi_bill_status.total'
Expand All @@ -35,8 +36,9 @@ def handle_error(e)
render json: { errors: e.errors }, status: status || :internal_server_error
end

# TO-DO: Remove this method after transition of LTS to 24/7 availability
def service_available?
unless BenefitsEducation::Service.within_scheduled_uptime?
unless Flipper.enabled?(:sob_updated_design) || BenefitsEducation::Service.within_scheduled_uptime?
StatsD.increment(STATSD_GI_BILL_FAIL_KEY, tags: ['error:scheduled_downtime'])
headers['Retry-After'] = BenefitsEducation::Service.retry_after_time
# 503 response
Expand Down Expand Up @@ -67,6 +69,7 @@ def user_json(user)
}.to_json
end

# TO-DO: Remove this method after transition of LTS to 24/7 availability
def skip_sentry_exception_types
super + [BenefitsEducation::OutsideWorkingHours]
end
Expand Down
10 changes: 7 additions & 3 deletions app/models/backend_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

require 'backend_services'

# TO-DO: After transition of Post-911 GI Bill to 24/7 availability, confirm
# BackendStatus (singular) model and related logic can be removed
class BackendStatus
include ActiveModel::Serialization
include ActiveModel::Validations
Expand All @@ -18,16 +20,18 @@ def initialize(name:, service_id: nil)
end

def available?
gibs_service? ? BenefitsEducation::Service.within_scheduled_uptime? : true
service_subject_to_downtime? ? BenefitsEducation::Service.within_scheduled_uptime? : true
end

def uptime_remaining
gibs_service? ? BenefitsEducation::Service.seconds_until_downtime.to_i : 0
service_subject_to_downtime? ? BenefitsEducation::Service.seconds_until_downtime.to_i : 0
end

private

def gibs_service?
def service_subject_to_downtime?
return false if Flipper.enabled?(:sob_updated_design)

@name == BackendServices::GI_BILL_STATUS
end
end
8 changes: 8 additions & 0 deletions app/models/form_submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ def with_form_types(form_types)
end
end

def form_data
super || '{}'
end

def latest_pending_attempt
form_submission_attempts.where(aasm_state: 'pending').order(created_at: :asc).last
end

def non_failure_attempt
form_submission_attempts.where(aasm_state: %w[pending success]).first
end
end
8 changes: 7 additions & 1 deletion app/models/form_submission_attempt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ class FormSubmissionAttempt < ApplicationRecord

event :fail do
after do
Rails.logger.info({
message: 'Preparing to send Form Submission Attempt error email',
form_submission_id:,
benefits_intake_uuid: form_submission&.benefits_intake_uuid,
form_type: form_submission&.form_type
})
enqueue_result_email(:error) if Flipper.enabled?(:simple_forms_email_notifications)
end

Expand Down Expand Up @@ -89,7 +95,7 @@ def enqueue_result_email(notification_type)
end

def time_to_send
now = Time.zone.now
now = Time.now.in_time_zone('Eastern Time (US & Canada)')
if now.hour < HOUR_TO_SEND_NOTIFICATIONS
now.change(hour: HOUR_TO_SEND_NOTIFICATIONS,
min: 0)
Expand Down
2 changes: 2 additions & 0 deletions app/serializers/backend_status_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

# TO-DO: After transition of Post-911 GI Bill to 24/7 availability, confirm
# serializer and related logic can be completely removed
class BackendStatusSerializer
include JSONAPI::Serializer

Expand Down
6 changes: 5 additions & 1 deletion app/serializers/service_history_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class ServiceHistorySerializer
set_id { '' }

attributes :service_history do |object|
object
object[:episodes]
end

attributes :vet_status_eligibility do |object|
object[:vet_status_eligibility]
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def payload
sub: service_account_access_token.user_identifier,
exp: service_account_access_token.expiration_time.to_i,
iat: service_account_access_token.created_time.to_i,
nbf: service_account_access_token.created_time.to_i,
version: service_account_access_token.version,
scopes: service_account_access_token.scopes,
service_account_id: service_account_access_token.service_account_id,
Expand Down
7 changes: 7 additions & 0 deletions app/swagger/swagger/requests/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,13 @@ class Profile
property :character_of_discharge_code, type: :string, example: 'DVN', description: 'The abbreviated code used to reference the status of a Servicemember upon termination of an episode'
end
end
property :vet_status_eligibility do
key :type, :object
items do
property :confirmed, type: :boolean
property :message, type: :array
end
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion config/betamocks/services_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
:endpoints:
- :method: :post
:path: '/v1/usermgmt/account-service/account'
:file_path: 'mhv/account_creation/create_account'
:file_path: 'mhv/account_creation/create_account/default'

- :name: 'MHV_Rx'
:base_uri: <%= "#{URI(Settings.mhv.rx.host).host}:#{URI(Settings.mhv.rx.host).port}" %>
Expand Down
32 changes: 18 additions & 14 deletions config/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ features:
actor_type: user
description: When enabled, claims status tool uses the new claim phase designs
enable_in_development: true
cst_include_ddl_5103_letters:
actor_type: user
description: When enabled, the Download Decision Letters feature includes 5103 letters
enable_in_development: true
cst_include_ddl_boa_letters:
actor_type: user
description: When enabled, the Download Decision Letters feature includes Board of Appeals decision letters
enable_in_development: true
cst_include_ddl_sqd_letters:
actor_type: user
description: When enabled, the Download Decision Letters feature includes Subsequent Development Letters
enable_in_development: true
cst_use_lighthouse_5103:
actor_type: user
description: When enabled, claims status tool uses the Lighthouse API for the 5103 endpoint
Expand All @@ -227,26 +239,18 @@ features:
actor_type: user
description: When enabled, claims status tool uses the Lighthouse API for the show endpoint
enable_in_development: true
cst_include_ddl_boa_letters:
actor_type: user
description: When enabled, the Download Decision Letters feature includes Board of Appeals decision letters
enable_in_development: true
cst_include_ddl_5103_letters:
cst_send_evidence_failure_emails:
actor_type: user
description: When enabled, the Download Decision Letters feature includes 5103 letters
description: When enabled, emails will be sent when evidence uploads from the CST fail
enable_in_development: true
cst_include_ddl_sqd_letters:
cst_synchronous_evidence_uploads:
actor_type: user
description: When enabled, the Download Decision Letters feature includes Subsequent Development Letters
description: When enabled, claims status tool uses synchronous evidence uploads
enable_in_development: true
cst_use_dd_rum:
actor_type: user
description: When enabled, claims status tool uses DataDog's Real User Monitoring logging
enable_in_development: false
cst_synchronous_evidence_uploads:
actor_type: user
description: When enabled, claims status tool uses synchronous evidence uploads
enable_in_development: true
coe_access:
actor_type: user
description: Feature gates the certificate of eligibility application
Expand Down Expand Up @@ -1034,9 +1038,9 @@ features:
profile_show_quick_submit_notification_setting:
actor_type: user
description: Show/Hide the quick submit section of notification settings in profile
profile_show_proof_of_veteran_status:
profile_show_proof_of_veteran_status_eligible:
actor_type: user
description: Show/Hide the proof of veteran status page and links
description: Include/exclude the proof of veteran status eligibility in service_history response
profile_use_experimental:
description: Use experimental features for Profile application - Do not remove
enable_in_development: true
Expand Down
2 changes: 2 additions & 0 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require 'sidekiq/set_request_id'
require 'sidekiq/set_request_attributes'
require 'datadog/statsd' # gem 'dogstatsd-ruby'
require 'admin/redis_health_checker'

Rails.application.reloader.to_prepare do
Sidekiq::Enterprise.unique! if Rails.env.production?
Expand Down Expand Up @@ -64,4 +65,5 @@
end

Sidekiq.strict_args!(false)
RedisHealthChecker.sidekiq_redis_up if Settings.vsp_environment != 'production'
end
10 changes: 8 additions & 2 deletions lib/disability_compensation/factories/api_provider_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,17 @@ def generate_pdf_service_provider
end

def supplemental_document_upload_service_provider
provider_options = [
@options[:form526_submission],
@options[:document_type],
@options[:statsd_metric_prefix]
]

case api_provider
when API_PROVIDER[:evss]
EVSSSupplementalDocumentUploadProvider.new(@options[:form526_submission])
EVSSSupplementalDocumentUploadProvider.new(*provider_options)
when API_PROVIDER[:lighthouse]
LighthouseSupplementalDocumentUploadProvider.new(@options[:form526_submission])
LighthouseSupplementalDocumentUploadProvider.new(*provider_options)
else
raise NotImplementedError, 'No known Supplemental Document Upload Api Provider type provided'
end
Expand Down
Loading

0 comments on commit c16cec5

Please sign in to comment.