Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/bundler/redis-5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rmtolmach authored Apr 17, 2024
2 parents 3a6e861 + 1d6b924 commit 1388fd9
Show file tree
Hide file tree
Showing 192 changed files with 6,177 additions and 1,893 deletions.
33 changes: 25 additions & 8 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ GEM
multipart-post (~> 2)
faraday-net_http (3.1.0)
net-http
faraday-retry (2.2.0)
faraday-retry (2.2.1)
faraday (~> 2.0)
faraday-typhoeus (1.1.0)
faraday (~> 2.0)
Expand Down Expand Up @@ -890,7 +890,7 @@ GEM
rswag-ui (2.13.0)
actionpack (>= 3.1, < 7.2)
railties (>= 3.1, < 7.2)
rubocop (1.63.1)
rubocop (1.63.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create
raise Common::Exceptions::ValidationErrors, claim
end

CentralMail::SubmitCareerCounselingJob.perform_async(claim.id, @current_user&.uuid)
Lighthouse::SubmitCareerCounselingJob.perform_async(claim.id, @current_user&.uuid)

Rails.logger.info "ClaimID=#{claim.confirmation_number} Form=#{claim.class::FORM}"
clear_saved_form(claim.form_id)
Expand Down
2 changes: 1 addition & 1 deletion app/models/personal_information_log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class PersonalInformationLog < ApplicationRecord
scope :last_week, -> { where('created_at >= :date', date: 1.week.ago) }

has_kms_key
has_encrypted :data, migrating: true, type: :json, key: :kms_key, **lockbox_options
has_encrypted :data, type: :json, key: :kms_key, **lockbox_options

validates :error_class, presence: true
end
8 changes: 6 additions & 2 deletions app/models/saved_claim/education_career_counseling_claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def regional_office
[]
end

def send_to_central_mail!
def send_to_benefits_intake!
form_copy = parsed_form

if form_copy['veteranSocialSecurityNumber'].blank?
Expand All @@ -27,7 +27,11 @@ def process_attachments!
files = PersistentAttachment.where(guid: refs.map(&:confirmationCode))
files.find_each { |f| f.update(saved_claim_id: id) }

CentralMail::SubmitSavedClaimJob.new.perform(id)
if Flipper.enabled?(:ecc_benefits_intake_submission)
Lighthouse::SubmitBenefitsIntakeClaim.new.perform(id)
else
CentralMail::SubmitSavedClaimJob.new.perform(id)
end
end

def business_line
Expand Down
14 changes: 14 additions & 0 deletions app/sidekiq/education_form/templates/10203.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
CH33
*START*
<%= form_identifier %>
<% if Settings.vsp_environment.eql?('production') -%>
JUN 2020
<% else -%>
OMB Control #: 2900-0878
<% end -%>


APPLICATION FOR EDITH NOURSE ROGERS STEM SCHOLARSHIP
Expand Down Expand Up @@ -69,8 +73,18 @@ Applicant has POA: <%= yesno(@stem_automated_decision.poa) %>
Applicant School Email Address: <%= @applicant.schoolEmailAddress %>
Applicant School ID: <%= @applicant.schoolStudentId %>

<% if Settings.vsp_environment.eql?('production') -%>
Certification and Signature of Applicant
Signature of Applicant Date
<% else -%>
<% if @applicant.isActiveDuty -%>
As an active-duty service member, you have consulted with an Education Service
Officer (ESO) regarding your education program.
<% else -%>
Certification and Signature of Applicant
Signature of Applicant Date
<% end -%>


<% end -%>
<%= parse_with_template_path('footer') %>
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
# frozen_string_literal: true

module CentralMail
module Lighthouse
class SubmitCareerCounselingJob
include Sidekiq::Job
include SentryLogging
RETRY = 14

STATSD_KEY_PREFIX = 'worker.central_mail.submit_career_counseling_job'
STATSD_KEY_PREFIX = 'worker.lighthouse.submit_career_counseling_job'

sidekiq_options retry: RETRY

sidekiq_retries_exhausted do |msg, _ex|
Rails.logger.error(
"Failed all retries on CentralMail::SubmitCareerCounselingJob, last error: #{msg['error_message']}"
"Failed all retries on SubmitCareerCounselingJob, last error: #{msg['error_message']}"
)
StatsD.increment("#{STATSD_KEY_PREFIX}.exhausted")
end

def perform(claim_id, user_uuid = nil)
begin
@claim = SavedClaim.find(claim_id)
@claim.send_to_central_mail!
@claim.send_to_benefits_intake!
send_confirmation_email(user_uuid)
rescue => e
log_message_to_sentry('CentralMail::SubmitCareerCounselingJob failed, retrying...', :warn,
generate_sentry_details(e))
Rails.logger.warn('SubmitCareerCounselingJob failed, retrying...', { error_message: e.message })
raise
end
log_message_to_sentry('Successfully submitted form 25-8832', :info, { uuid: user_uuid })
Rails.logger.info('Successfully submitted form 25-8832', { uuid: user_uuid })
end

def send_confirmation_email(user_uuid)
Expand All @@ -38,8 +36,7 @@ def send_confirmation_email(user_uuid)
end

if email.blank?
log_message_to_sentry('No email to send confirmation regarding submitted form 25-8832', :info,
{ uuid: user_uuid })
Rails.logger.info("No email to send confirmation regarding submitted form 25-8832 for uuid: #{user_uuid}")
return
end

Expand Down
7 changes: 7 additions & 0 deletions config/features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,10 @@ features:
actor_type: user
description: Enables sleep apnea supplies to be ordered in the supply reorder tool / MDOT.
enable_in_development: true
toe_dup_contact_info_call:
actor_type: user
description: Flag to use contact info call and modal
enable_in_development: true
toe_short_circuit_bgs_failure:
actor_type: user
description: Flag to use begin rescue block for BGS call
Expand Down Expand Up @@ -1352,6 +1356,9 @@ features:
central_mail_benefits_intake_submission:
actor_type: user
description: Enable central mail claims submission uses Benefits Intake API
ecc_benefits_intake_submission:
actor_type: user
description: Enable education and career counseling claim submissions to use Benefits Intake API
virtual_agent_enable_param_error_detection:
actor_type: user
description: If enabled, Allows for the detection of errors in the chatbot params
Expand Down
6 changes: 6 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,12 @@ lighthouse:
rsa_key: ~
aud_claim_url: https://deptva-eval.okta.com/oauth2/ausln2mo4jCAYRrlR2p7/v1/token
use_mocks: false
benefits_intake:
host: https://sandbox-api.va.gov
path: /services/vba_documents
version: v1
use_mocks: false
api_key: ~
letters_generator:
url: https://sandbox-api.va.gov
path: /services/va-letter-generator/v1/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class DropDataInPersonalInformationLog < ActiveRecord::Migration[7.1]
def change
safety_assured { remove_column :personal_information_logs, :data, :jsonb }
end
end
40 changes: 40 additions & 0 deletions db/migrate/20240411153910_create_accredited_individuals.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true

class CreateAccreditedIndividuals < ActiveRecord::Migration[7.1]
def change
create_table :accredited_individuals, id: :uuid do |t|
t.uuid :ogc_id, null: false
t.string :registration_number, null: false
t.string :poa_code, limit: 3, index: true
t.string :individual_type, null: false
t.string :first_name
t.string :middle_initial
t.string :last_name
t.string :full_name, index: true
t.string :email
t.string :phone
t.string :address_type
t.string :address_line1
t.string :address_line2
t.string :address_line3
t.string :city
t.string :country_code_iso3
t.string :country_name
t.string :county_name
t.string :county_code
t.string :international_postal_code
t.string :province
t.string :state_code
t.string :zip_code
t.string :zip_suffix
t.jsonb :raw_address
t.float :lat
t.float :long
t.geography :location, limit: { srid: 4326, type: 'st_point', geographic: true }
t.timestamps

t.index :location, using: :gist
t.index %i[ registration_number individual_type ], name: 'index_on_reg_num_and_type_for_accredited_individuals', unique: true
end
end
end
33 changes: 33 additions & 0 deletions db/migrate/20240411160306_create_accredited_organizations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

class CreateAccreditedOrganizations < ActiveRecord::Migration[7.1]
def change
create_table :accredited_organizations, id: :uuid do |t|
t.uuid :ogc_id, null: false
t.string :poa_code, limit: 3, null: false, index: { unique: true }
t.string :name, index: true
t.string :phone
t.string :address_type
t.string :address_line1
t.string :address_line2
t.string :address_line3
t.string :city
t.string :country_code_iso3
t.string :country_name
t.string :county_name
t.string :county_code
t.string :international_postal_code
t.string :province
t.string :state_code
t.string :zip_code
t.string :zip_suffix
t.jsonb :raw_address
t.float :lat
t.float :long
t.geography :location, limit: { srid: 4326, type: 'st_point', geographic: true }
t.timestamps

t.index :location, using: :gist
end
end
end
68 changes: 67 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1388fd9

Please sign in to comment.