Skip to content

Commit

Permalink
Revert "Release R2.3.0 FY24Q4.3.0 (#22517)"
Browse files Browse the repository at this point in the history
This reverts commit 6dd9870.
  • Loading branch information
craigrva authored Aug 22, 2024
1 parent 6dd9870 commit f7e5aee
Show file tree
Hide file tree
Showing 24 changed files with 257 additions and 876 deletions.
5 changes: 1 addition & 4 deletions app/controllers/intakes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def intake_ui_hash
{ unread_messages: unread_messages? }
end

# rubocop:disable Metrics/AbcSize
def feature_toggle_ui_hash
{
useAmaActivationDate: FeatureToggle.enabled?(:use_ama_activation_date, user: current_user),
Expand All @@ -161,11 +160,9 @@ def feature_toggle_ui_hash
updatedAppealForm: FeatureToggle.enabled?(:updated_appeal_form, user: current_user),
hlrScUnrecognizedClaimants: FeatureToggle.enabled?(:hlr_sc_unrecognized_claimants, user: current_user),
vhaClaimReviewEstablishment: FeatureToggle.enabled?(:vha_claim_review_establishment, user: current_user),
metricsBrowserError: FeatureToggle.enabled?(:metrics_browser_error, user: current_user),
removeCompAndPenIntake: FeatureToggle.enabled?(:remove_comp_and_pen_intake, user: current_user)
metricsBrowserError: FeatureToggle.enabled?(:metrics_browser_error, user: current_user)
}
end
# rubocop:enable Metrics/AbcSize

def user_information_ui_hash
{
Expand Down
114 changes: 40 additions & 74 deletions app/controllers/issues_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class IssuesController < ApplicationController
handle_non_critical_error("issues", e)
end

# rubocop:disable Layout/LineLength
def create
return record_not_found unless appeal

Expand All @@ -26,24 +27,21 @@ def create
if convert_to_bool(create_params[:mst_status]) ||
convert_to_bool(create_params[:pact_status])
issue_in_caseflow = appeal.issues.find { |iss| iss.vacols_sequence_id == issue.issseq.to_i }
create_legacy_issue_update_task(issue_in_caseflow) if FeatureToggle.enabled?(
:legacy_mst_pact_identification, user: RequestStore[:current_user]
)
create_legacy_issue_update_task(issue_in_caseflow) if FeatureToggle.enabled?(:legacy_mst_pact_identification, user: RequestStore[:current_user])
end

render json: { issues: json_issues }, status: :created
end
# rubocop:enable Layout/LineLength

# rubocop:disable Metrics/AbcSize
# rubocop:disable Layout/LineLength, Metrics/AbcSize
def update
return record_not_found unless appeal

issue = appeal.issues.find { |iss| iss.vacols_sequence_id == params[:vacols_sequence_id].to_i }
if issue.mst_status != convert_to_bool(params[:issues][:mst_status]) ||
issue.pact_status != convert_to_bool(params[:issues][:pact_status])
create_legacy_issue_update_task(issue) if FeatureToggle.enabled?(
:legacy_mst_pact_identification, user: RequestStore[:current_user]
)
create_legacy_issue_update_task(issue) if FeatureToggle.enabled?(:legacy_mst_pact_identification, user: RequestStore[:current_user])
end

Issue.update_in_vacols!(
Expand All @@ -57,7 +55,7 @@ def update

render json: { issues: json_issues }, status: :ok
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Layout/LineLength, Metrics/AbcSize

def destroy
return record_not_found unless appeal
Expand All @@ -71,7 +69,10 @@ def destroy

private

# rubocop:disable Layout/LineLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
def create_legacy_issue_update_task(issue)
user = current_user

# close out any tasks that might be open
open_issue_task = Task.where(
assigned_to: SpecialIssueEditTeam.singleton
Expand All @@ -82,98 +83,63 @@ def create_legacy_issue_update_task(issue)
appeal: appeal,
parent: appeal.root_task,
assigned_to: SpecialIssueEditTeam.singleton,
assigned_by: current_user,
completed_by: current_user
assigned_by: user,
completed_by: user
)
task_instructions_helper(issue, task)
end

# rubocop:disable Metrics/MethodLength
def task_instructions_helper(issue, task)
# set up data for added or edited issue depending on the params action
disposition = issue.readable_disposition.nil? ? "N/A" : issue.readable_disposition
change_category = (params[:action] == "create") ? "Added Issue" : "Edited Issue"
updated_mst_status = convert_to_bool(params[:issues][:mst_status]) unless params[:action] == "create"
updated_pact_status = convert_to_bool(params[:issues][:pact_status]) unless params[:action] == "create"
instruction_params = {
issue: issue,
task: task,
updated_mst_status: updated_mst_status,
updated_pact_status: updated_pact_status,
change_category: change_category
}
format_instructions(instruction_params)

# create SpecialIssueChange record to log the changes
SpecialIssueChange.create!(
issue_id: issue.id,
appeal_id: appeal.id,
appeal_type: "LegacyAppeal",
task_id: task.id,
created_at: Time.zone.now.utc,
created_by_id: current_user.id,
created_by_css_id: current_user.css_id,
original_mst_status: issue.mst_status,
original_pact_status: issue.pact_status,
updated_mst_status: updated_mst_status,
updated_pact_status: updated_pact_status,
change_category: change_category
)
end

# formats and saves task instructions
# rubocop:disable Metrics/AbcSize
# :reek:FeatureEnvy
def format_instructions(inst_params)
note = params[:issues][:note].nil? ? "N/A" : params[:issues][:note]
# use codes from params to get descriptions
# opting to use params vs issue model to capture in-flight issue changes
program_code = params[:issues][:program]
issue_code = params[:issues][:issue]
level_1_code = params[:issues][:level_1]

# line up param codes to their descriptions
param_issue = Constants::ISSUE_INFO[program_code]
iss = param_issue["levels"][issue_code]["description"] unless issue_code.nil?

issue_code_message = build_issue_code_message(issue_code, param_issue)
level_1_description = level_1_code.nil? ? "N/A" : param_issue["levels"][issue_code]["levels"][level_1_code]["description"]

# format the task instructions and close out
set = CaseTimelineInstructionSet.new(
change_type: inst_params[:change_category],
change_type: change_category,
issue_category: [
"Benefit Type: #{param_issue['description']}\n",
"Issue: #{iss}\n",
"Code: #{issue_code_message}\n",
"Note: #{note}\n"
"Code: #{[level_1_code, level_1_description].join(' - ')}\n",
"Note: #{note}\n",
"Disposition: #{disposition}\n"
].compact.join("\r\n"),
benefit_type: "",
original_mst: inst_params[:issue].mst_status,
original_pact: inst_params[:issue].pact_status,
edit_mst: inst_params[:updated_mst_status],
edit_pact: inst_params[:updated_pact_status]
original_mst: issue.mst_status,
original_pact: issue.pact_status,
edit_mst: updated_mst_status,
edit_pact: updated_pact_status
)
task.format_instructions(set)
task.completed!
# create SpecialIssueChange record to log the changes
SpecialIssueChange.create!(
issue_id: issue.id,
appeal_id: appeal.id,
appeal_type: "LegacyAppeal",
task_id: task.id,
created_at: Time.zone.now.utc,
created_by_id: user.id,
created_by_css_id: user.css_id,
original_mst_status: issue.mst_status,
original_pact_status: issue.pact_status,
updated_mst_status: updated_mst_status,
updated_pact_status: updated_pact_status,
change_category: change_category
)
inst_params[:task].format_instructions(set)
inst_params[:task].completed!
end
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize

# builds issue code on IssuesUpdateTask for MST/PACT changes
def build_issue_code_message(issue_code, param_issue)
level_1_code = params[:issues][:level_1]
diagnostic_code = params[:issues][:level_2]

# use diagnostic code message if it exists
if !diagnostic_code.blank?
diagnostic_description = Constants::DIAGNOSTIC_CODE_DESCRIPTIONS[diagnostic_code]["staff_description"]
[diagnostic_code, diagnostic_description].join(" - ")
# use level 1 message if it exists
elsif !level_1_code.blank?
level_1_description = param_issue["levels"][issue_code]["levels"][level_1_code]["description"]
[level_1_code, level_1_description].join(" - ")
# return N/A if none exist
else
"N/A"
end
end
# rubocop:enable Layout/LineLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity

def convert_to_bool(status)
status == "Y"
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/dispatch_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
##
# rubocop:disable Rails/ApplicationMailer
class DispatchMailer < ActionMailer::Base
default from: "Board of Veterans' Appeals <BoardofVeteransAppealsDecisions@messages.va.gov>"
default from: "Board of Veterans' Appeals <BoardofVeteransAppealsHearings@messages.va.gov>"
layout "dispatch_mailer"
helper VirtualHearings::LinkHelper

Expand Down
6 changes: 5 additions & 1 deletion app/models/distribution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

class Distribution < CaseflowRecord
include ActiveModel::Serializers::JSON
include ByDocketDateDistribution
if FeatureToggle.enabled?(:acd_distribute_by_docket_date, user: RequestStore.store[:current_user])
include ByDocketDateDistribution
else
include AutomaticCaseDistribution
end

has_many :distributed_cases
belongs_to :judge, class_name: "User"
Expand Down
3 changes: 3 additions & 0 deletions app/models/request_issues_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ def validate_before_perform
if !changes?
@error_code = :no_changes
elsif RequestIssuesUpdate.where(review: review).where.not(id: id).processable.exists?
if @error_code == :no_changes
RequestIssuesUpdate.where(review: review).where.not(id: id).processable.last.destroy
end
@error_code = :previous_update_not_done_processing
end

Expand Down
65 changes: 23 additions & 42 deletions app/queries/appeals_ready_for_distribution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,53 +44,35 @@ def self.ready_appeals
.flat_map do |sym, docket|
appeals = docket.ready_to_distribute_appeals
if sym == :legacy
legacy_rows(appeals, sym)
legacy_rows(appeals, docket, sym)
else
ama_rows(appeals, docket, sym)
end
end
end

def self.legacy_rows(appeals, sym)
def self.legacy_rows(appeals, docket, sym)
appeals.map do |appeal|
build_appeal_row(appeal, sym)
end
end

def self.build_appeal_row(appeal, sym)
veteran_name = format_veteran_name(appeal["snamef"], appeal["snamel"])
hearing_judge = format_vlj_name(appeal["vlj_namef"], appeal["vlj_namel"])
appeal_affinity = fetch_affinity_start_date(appeal["bfkey"])

{
docket_number: appeal["tinum"],
docket: sym.to_s,
aod: appeal["aod"] == 1,
cavc: appeal["cavc"] == 1,
receipt_date: appeal["bfd19"],
ready_for_distribution_at: appeal["bfdloout"],
target_distro_date: target_distro_date(appeal["bfd19"], sym),
days_before_goal_date: days_before_goal_date(appeal["bfd19"], sym),
hearing_judge: hearing_judge,
original_judge: legacy_original_deciding_judge(appeal),
veteran_file_number: appeal["ssn"] || appeal["bfcorlid"],
veteran_name: veteran_name,
affinity_start_date: appeal_affinity
}
end

def self.format_vlj_name(first_name, last_name)
name = FullName.new(first_name, nil, last_name).to_s
name.empty? ? nil : name
end
veteran_name = FullName.new(appeal["snamef"], nil, appeal["snamel"]).to_s
vlj_name = FullName.new(appeal["vlj_namef"], nil, appeal["vlj_namel"]).to_s
hearing_judge = vlj_name.empty? ? nil : vlj_name
appeal_affinity = AppealAffinity.find_by(case_id: appeal["bfkey"], case_type: "VACOLS::Case")

def self.format_veteran_name(first_name, last_name)
FullName.new(first_name, nil, last_name).to_s
end

def self.fetch_affinity_start_date(case_id)
appeal_affinity = AppealAffinity.find_by(case_id: case_id, case_type: "VACOLS::Case")
appeal_affinity&.affinity_start_date
{
docket_number: appeal["tinum"],
docket: sym.to_s,
aod: appeal["aod"] == 1,
cavc: appeal["cavc"] == 1,
receipt_date: appeal["bfd19"],
ready_for_distribution_at: appeal["bfdloout"],
target_distro_date: target_distro_date(appeal["bfd19"], docket),
days_before_goal_date: days_before_goal_date(appeal["bfd19"], docket),
hearing_judge: hearing_judge,
veteran_file_number: appeal["ssn"] || appeal["bfcorlid"],
veteran_name: veteran_name,
affinity_start_date: appeal_affinity&.affinity_start_date
}
end
end

def self.ama_rows(appeals, docket, sym)
Expand All @@ -99,16 +81,15 @@ def self.ama_rows(appeals, docket, sym)
ready_for_distribution_at = distribution_task_query(appeal)
# only look for hearings that were held
hearing_judge = with_held_hearings(appeal)
priority_appeal = appeal.aod || appeal.cavc
{
docket_number: appeal.docket_number,
docket: sym.to_s,
aod: appeal.aod,
cavc: appeal.cavc,
receipt_date: appeal.receipt_date,
ready_for_distribution_at: ready_for_distribution_at,
target_distro_date: priority_appeal ? "N/A" : target_distro_date(appeal.receipt_date, docket),
days_before_goal_date: priority_appeal ? "N/A" : days_before_goal_date(appeal.receipt_date, docket),
target_distro_date: target_distro_date(appeal.receipt_date, docket),
days_before_goal_date: days_before_goal_date(appeal.receipt_date, docket),
hearing_judge: hearing_judge,
veteran_file_number: appeal.veteran_file_number,
veteran_name: appeal.veteran&.name.to_s,
Expand Down
1 change: 0 additions & 1 deletion client/COPY.json
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,6 @@
"INTAKE_EDIT_ISSUE_BENEFIT_TYPE": "Benefit type: ",
"INTAKE_EDIT_ISSUE_DECISION_DATE": "Decision date: ",
"INTAKE_VHA_CLAIM_REVIEW_REQUIREMENT": "Only VHA team members can establish Higher Level Reviews and Supplemental Claims with VHA issues. If you have a VHA claim, please return the packet to the main “VHA” queue in the Centralized Mail Portal or send downloaded documents to %s.",
"INTAKE_REMOVE_COMP_AND_PEN": "Higher Level Reviews and Supplemental Claims with Compensation and Pension & Survivor's Benefits are now handled through VBMS and are no longer established through Caseflow",
"VHA_BENEFIT_EMAIL_ADDRESS": "VHABENEFITAPPEALS@va.gov",
"VHA_CAREGIVER_SUPPORT_EMAIL_ADDRESS": "VHA.CSPAppeals@va.gov",
"VHA_PAYMENT_OPERATIONS_EMAIL_ADDRESS": "VHA10D1B3R2Appeals@va.gov",
Expand Down
4 changes: 1 addition & 3 deletions client/app/intake/components/BenefitType.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ export default class BenefitType extends React.PureComponent {
// If the feature toggle is off then all users should be able to select vha
const canSelectVhaBenefit = featureToggles.vhaClaimReviewEstablishment ? userCanSelectVha : true;

const canSelectCompAndPen = !featureToggles.removeCompAndPenIntake;

return <div className="cf-benefit-type" style={{ marginTop: '10px' }} >
<RadioField
name="benefit-type-options"
label="What is the Benefit Type?"
strongLabel
vertical
options={formatBenefitTypeRadioOptions(BENEFIT_TYPES, canSelectVhaBenefit, canSelectCompAndPen)}
options={formatBenefitTypeRadioOptions(BENEFIT_TYPES, canSelectVhaBenefit)}
onChange={onChange}
value={value}
errorMessage={errorMessage}
Expand Down
Loading

0 comments on commit f7e5aee

Please sign in to comment.