Skip to content

Commit

Permalink
Merge branch 'master' into MHV-57328/update-sort-options
Browse files Browse the repository at this point in the history
  • Loading branch information
agravell047 authored Apr 25, 2024
2 parents 08e1e07 + 8a4a934 commit e25d925
Show file tree
Hide file tree
Showing 42 changed files with 1,358 additions and 126 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ GEM
stringio (3.1.0)
strong_migrations (1.8.0)
activerecord (>= 5.2)
super_diff (0.11.0)
super_diff (0.12.0)
attr_extras (>= 6.2.4)
diff-lcs
patience_diff
Expand Down
30 changes: 23 additions & 7 deletions app/controllers/v0/profile/direct_deposits_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ module Profile
class DirectDepositsController < ApplicationController
service_tag 'direct-deposit'
before_action { authorize :lighthouse, :direct_deposit_access? }
before_action :payment_account, only: :update
before_action :control_information, only: :update

after_action :log_sso_info, only: :update

rescue_from(*Lighthouse::ServiceException::ERROR_MAP.values) do |exception|
Expand All @@ -28,12 +27,19 @@ class DirectDepositsController < ApplicationController
def show
response = client.get_payment_info

set_control_information(response.body[:control_information])
log_control_info(@control_information, 'Show')

render status: response.status,
json: response.body,
serializer: DisabilityCompensationsSerializer
end

def update
set_control_information(control_info_params)
set_payment_account(payment_account_params)

log_control_info(@control_information, 'Update')
response = client.update_payment_info(@payment_account)
send_confirmation_email

Expand All @@ -44,6 +50,15 @@ def update

private

def log_control_info(control_info, action)
::Rails.logger.info("Direct Deposit Control Info: #{action}",
{ benefit_type: control_info.benefit_type,
updatable: control_info.account_updatable?,
valid: control_info.valid?,
restrictions: control_info.restrictions.join(', '),
errors: control_info.errors.join(', ') })
end

def single_form_enabled?
Flipper.enabled?(:profile_show_direct_deposit_single_form, @current_user)
end
Expand All @@ -56,12 +71,13 @@ def client
@client ||= DirectDeposit::Client.new(@current_user.icn)
end

def payment_account
@payment_account ||= Lighthouse::DirectDeposit::PaymentAccount.new(payment_account_params)
def set_payment_account(params)
@payment_account ||= Lighthouse::DirectDeposit::PaymentAccount.new(params)
end

def control_information
@control_information ||= Lighthouse::DirectDeposit::ControlInformation.new(control_info_params)
def set_control_information(params)
@control_information ||= Lighthouse::DirectDeposit::ControlInformation.new
@control_information.assign_attributes(params)
end

def payment_account_params
Expand All @@ -84,7 +100,7 @@ def control_info_params
:has_no_fiduciary_assigned,
:is_not_deceased,
:has_payment_address,
:has_indentity)
:has_identity)
end

def send_confirmation_email
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This migration comes from vye (originally 20240303145700)
class RemoveSsnAndIcnFromVyeTables < ActiveRecord::Migration[7.0]
def change
safety_assured do
remove_columns(
:vye_user_infos,
:icn,
:ssn_ciphertext,
:ssn_digest
)

remove_columns(
:vye_pending_documents,
:claim_no_ciphertext,
:ssn_ciphertext,
:ssn_digest
)
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This migration comes from vye (originally 20240305034315)
class RemoveAddressDetailsFromVyeUserInfos < ActiveRecord::Migration[7.0]
def change
safety_assured do
remove_columns(
:vye_user_infos,
:full_name_ciphertext,
:address_line2_ciphertext,
:address_line3_ciphertext,
:address_line4_ciphertext,
:address_line5_ciphertext,
:address_line6_ciphertext,
:zip_ciphertext
)
end
end
end
16 changes: 16 additions & 0 deletions db/migrate/20240424132508_change_datetime_to_date.vye.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This migration comes from vye (originally 20240415205522)
class ChangeDatetimeToDate < ActiveRecord::Migration[7.1]
def change
safety_assured do
change_column :vye_awards, :award_begin_date, :date
change_column :vye_awards, :award_end_date, :date
change_column :vye_awards, :payment_date, :date

change_column :vye_pending_documents, :queue_date, :date

change_column :vye_user_infos, :cert_issue_date, :date
change_column :vye_user_infos, :del_date, :date
change_column :vye_user_infos, :date_last_certified, :date
end
end
end
15 changes: 15 additions & 0 deletions db/migrate/20240424132509_update_verifications.vye.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This migration comes from vye (originally 20240415220728)
class UpdateVerifications < ActiveRecord::Migration[7.1]
disable_ddl_transaction!

def change
add_column :vye_verifications, :user_profile_id, :integer
add_column :vye_verifications, :monthly_rate, :decimal
add_column :vye_verifications, :number_hours, :integer
add_column :vye_verifications, :payment_date, :date
add_column :vye_verifications, :transact_date, :date
add_column :vye_verifications, :trace, :string

add_index :vye_verifications, :user_profile_id, algorithm: :concurrently
end
end
15 changes: 15 additions & 0 deletions db/migrate/20240424132510_create_vye_bdn_clones.vye.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This migration comes from vye (originally 20240422033815)
class CreateVyeBdnClones < ActiveRecord::Migration[7.1]
def change
create_table :vye_bdn_clones do |t|
t.boolean :is_active
t.boolean :export_ready
t.date :transact_date

t.timestamps
end

add_index :vye_bdn_clones, :is_active, unique: true, where: "is_active IS NOT NULL"
add_index :vye_bdn_clones, :export_ready, unique: true, where: "export_ready IS NOT NULL"
end
end
14 changes: 14 additions & 0 deletions db/migrate/20240424132511_add_to_vye_user_infos.vye.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This migration comes from vye (originally 20240422043836)
class AddToVyeUserInfos < ActiveRecord::Migration[7.1]
disable_ddl_transaction!

def change
add_column :vye_user_infos, :bdn_clone_id, :integer
add_column :vye_user_infos, :bdn_clone_line, :integer
add_column :vye_user_infos, :bdn_clone_active, :boolean

add_index :vye_user_infos, :bdn_clone_id, algorithm: :concurrently
add_index :vye_user_infos, :bdn_clone_line, algorithm: :concurrently
add_index :vye_user_infos, :bdn_clone_active, algorithm: :concurrently
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This migration comes from vye (originally 20240422051918)
class RemoveFromVyePendingDocument < ActiveRecord::Migration[7.1]
def change
safety_assured do
remove_column :vye_pending_documents, :encrypted_kms_key
end
end
end
56 changes: 31 additions & 25 deletions db/schema.rb

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

Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def translate
output_form.update(translate_veteran)
output_form.update(translate_treatments)
output_form.update(translate_disabilities)
output_form.update(add_toxic_exposure) if Flipper.enabled?(:disability_526_toxic_exposure, @current_user)

@translated_form
end
Expand Down Expand Up @@ -629,6 +630,14 @@ def map_secondary(input_disability, disabilities)
end
end

###
# Toxic Exposure
###

def add_toxic_exposure
{ 'toxicExposure' => input_form['toxicExposure'] }
end

def application_expiration_date
1.year.from_now.iso8601
end
Expand Down
Loading

0 comments on commit e25d925

Please sign in to comment.