Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/APPEALS-17497 MST/PACT Act Special Identification #18472

Merged
merged 192 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
646f7b6
jHoang/APPEALS-17511 (#18444)
jonathanh-va Apr 13, 2023
297ba67
Justin/appeals 17512 (#18443)
sulak-j Apr 14, 2023
b0d9eda
APPEALS-17506: MST & PACT Components (#18451)
youfoundmanesh Apr 14, 2023
f9420f1
jHoang/APPEALS-17511 (#18444)
jonathanh-va Apr 13, 2023
5385a89
Justin/appeals 17512 (#18443)
sulak-j Apr 14, 2023
5c91c73
APPEALS-17506: MST & PACT Components (#18451)
youfoundmanesh Apr 14, 2023
0a017b8
HunJerBAH/APPEALS-17509: Mocking BGS Contentions in Test Data (#18457)
HunJerBAH Apr 18, 2023
cc42b04
Ki/appeals 17508 v3 - Add Edit Issues Dropdown (#18453)
KiMauVA Apr 18, 2023
ffcbbb5
removed MST (#18455)
IsaiahBar Apr 19, 2023
ea649c9
jHoang/APPEALS-17523 (#18466)
jonathanh-va Apr 19, 2023
f555f7a
Merge branch 'feature/APPEALS-17497' of https://github.com/department…
HunJerBAH Apr 20, 2023
78dcf8e
jHoang/APPEALS-17511 (#18444)
jonathanh-va Apr 13, 2023
06bfbe5
Justin/appeals 17512 (#18443)
sulak-j Apr 14, 2023
b9d153e
APPEALS-17506: MST & PACT Components (#18451)
youfoundmanesh Apr 14, 2023
e58b8a3
HunJerBAH/APPEALS-17509: Mocking BGS Contentions in Test Data (#18457)
HunJerBAH Apr 18, 2023
0d66b2a
Ki/appeals 17508 v3 - Add Edit Issues Dropdown (#18453)
KiMauVA Apr 18, 2023
a4bfd3f
removed MST (#18455)
IsaiahBar Apr 19, 2023
3bd8416
jHoang/APPEALS-17523 (#18466)
jonathanh-va Apr 19, 2023
528a0df
HunJerBAH/APPEALS-17522: Create IssuesUpdate Task Model (#18465)
HunJerBAH Apr 21, 2023
fbebe5b
Merge branch 'feature/APPEALS-17497' of https://github.com/department…
HunJerBAH Apr 21, 2023
63debf5
APPEALS-17504 updated vacols tables sql to add new columns to issues …
kristeja Apr 24, 2023
b1b7b8c
Ryan/appeals 17514/mst pact checkboxes (Redo) (#18496)
Rnmarshall93 Apr 24, 2023
3d35d8b
Ki/APPEALS-17507 & 17520 - Edit Modal Created, Connect Dropdown and M…
KiMauVA Apr 24, 2023
afb20fb
added methods that return mst/pact status (#18470)
isaiahsaucedo Apr 26, 2023
7b3b9e8
Justin/appeals 17515 (#18486)
sulak-j Apr 26, 2023
cb48dff
added bgs service record maker to seed script for demo (#18521)
HunJerBAH Apr 28, 2023
ad829d9
JHoang/appeals 17546 (#18512)
jonathanh-va May 3, 2023
02358df
HunJerBAH/APPEALS-17551 (#18523)
HunJerBAH May 3, 2023
bddd735
APPEALS-17528 Added mst and pact methods to appeals model (#18524)
kristeja May 3, 2023
43fa896
APPEALS-17536 - Special Issues designation updated (#18517)
KiMauVA May 3, 2023
d5c043c
Jhoang/appeals 21860 (#18545)
jonathanh-va May 5, 2023
a65c615
HunJerBAH/APPEALS-17497 hot fixes (#18538)
HunJerBAH May 5, 2023
b200dc9
updated payload, rspecs, controller params (#18560)
jonathanh-va May 8, 2023
e4a3b70
redirect AMA appeals directly to Add Decisions page (#18533)
IsaiahBar May 8, 2023
ca4d36e
17513 pre-populate MST/PACT checkboxes if data is present in the mode…
Rnmarshall93 May 8, 2023
b4c9bbd
Revert "17513 pre-populate MST/PACT checkboxes if data is present in …
youfoundmanesh May 8, 2023
0cf2349
Justin/appeals 17533 (#18531)
sulak-j May 8, 2023
58036e0
APPEALS-21906: MST & PACT reasons migration (#18572)
youfoundmanesh May 8, 2023
f28580f
Ryan appeals/17513 redo (#18573)
Rnmarshall93 May 8, 2023
c79180e
Justin/APPEALS-17533-fix (#18577)
sulak-j May 9, 2023
08e21c6
will/appeals 17529 (#18574)
wmedders21 May 9, 2023
6b6ff27
Migration updates
youfoundmanesh May 9, 2023
434e588
Merge branch 'master' into feature/APPEALS-17497
kristeja May 10, 2023
c88e340
APPEALS-21842 Added mst and pact methods to legacy appeals model (#18…
kristeja May 10, 2023
1d226e6
APPEALS-17536 - Hotfix for prop naming (#18581)
KiMauVA May 10, 2023
4f68c83
Feature/appeals 17521/legacy edit issues (#18585)
jonathanh-va May 14, 2023
7c6ae25
Will/appeals 17561 (#18583)
wmedders21 May 14, 2023
baab0fc
fixed sentry bug for mst_available in contestable issue model (#18605)
HunJerBAH May 16, 2023
3a5f1d0
Ki/appeals 21905 (#18604)
KiMauVA May 16, 2023
5e5ce84
Added MST and PACT reason for change label + data passing) (Re-do) (#…
Rnmarshall93 May 16, 2023
1a4def2
Justin/APPEALS-22806 (#18618)
sulak-j May 18, 2023
d1c3856
APPEALS-17535: Docket MST & PACT (#18619)
youfoundmanesh May 18, 2023
1910ced
added try block to contestable issue model cycling request issues (#1…
HunJerBAH May 18, 2023
7f22181
Fix: added mst and pact Justification to AppealsController#update par…
wmedders21 May 18, 2023
0bcc8ba
Justin/APPEALS-22161 (#18610)
sulak-j May 22, 2023
5e5e1be
JHoang/APPEALS-17552 (#18620)
jonathanh-va May 22, 2023
4424646
added intake permissions to COB users in test data. (#18652)
HunJerBAH May 24, 2023
fcec2f3
fix checkbox not prepopulating on mst/pact issue legacy decision (#18…
jonathanh-va May 24, 2023
16d808e
Justin/APPEALS-23333 (#18655)
sulak-j May 26, 2023
7984876
Ricky/appeals 17558 (#18653)
Blake-Manus May 26, 2023
99faa21
HunJerBAH/Legacy and AMA Edit Page Bug Fix (#18658)
HunJerBAH May 26, 2023
da804f9
Legacy MST/PACT Justification Text Field in Add Decisions Workflow (#…
Kevma50287 May 26, 2023
8350779
Merge branch 'master' into feature/APPEALS-17497
HunJerBAH May 31, 2023
3231ebe
Ki/APPEALS-18872 - Create MST & PACT Conditional Rendering within Bad…
KiMauVA May 31, 2023
c643d18
APPEALS-23363: Case Timeline Entry Details: Editing Designation for A…
Kevma50287 Jun 1, 2023
e7e65f7
Ryan appeals 23327 (#18684)
Rnmarshall93 Jun 1, 2023
f025543
HunJerBAH APPEALS-23300: IssueUpdate Task Created when MST/PACT Edite…
HunJerBAH Jun 1, 2023
6aa26bb
Appeals 23336 - BUGFIX - Update back button routing for AMA in Add De…
Kevma50287 Jun 2, 2023
4a48795
Justin/APPEALS-23364 (#18688)
sulak-j Jun 4, 2023
4917572
Ki/APPEALS-23390 - Modify IDT API to reflect MST/PACT Act appeals (#1…
KiMauVA Jun 4, 2023
987e714
APPEALS-22938 (#18669)
Blake-Manus Jun 5, 2023
74d4339
Isaiah b/appeals 23322 (#18703)
IsaiahBar Jun 5, 2023
9fd2563
Feature: Establishment Task during AMA Intake (#18670)
wmedders21 Jun 5, 2023
cfeeb92
Bug Fix: cycle through array backwards when creating IssuesUpdateTask…
wmedders21 Jun 5, 2023
ac8f055
HunJerBAH/APPEALS 23467: Updated MST/PACT Edit AMA Appeal Success Ban…
HunJerBAH Jun 5, 2023
83bd399
APPEALS-23318 MST/PACT VBMS Ratings Special Issue Designation (#18685)
kristeja Jun 7, 2023
6909115
APPEALS-23556 - Fix casing for Pact Act (#18705)
KiMauVA Jun 7, 2023
b49bb83
APPEALS-22938 - hotfix (#18720)
Blake-Manus Jun 7, 2023
da4f9f2
Khalin/appeals 23400 (#18712)
Dev-KRedd Jun 7, 2023
455da89
Justin/APPEALS-23365 (#18690)
sulak-j Jun 8, 2023
4f59617
Updates logic for Caseflow to pull contention level special issues fr…
youfoundmanesh Jun 8, 2023
164efc2
Merge branch 'master' into feature/APPEALS-17497
HunJerBAH Jun 9, 2023
96d3187
Adjust spacing for issueupdatetask + fix linting (#18734)
Kevma50287 Jun 12, 2023
ab99388
fixed no description on issue update task after creation from edit is…
jonathanh-va Jun 12, 2023
7f74ad6
VBMS generators using bgs_contention (#18740)
wmedders21 Jun 12, 2023
98c48f5
set sequencing of the field as per wireframe (#18741)
SanthiParakal133 Jun 12, 2023
4d56e2c
check if previously mst was true (#18730)
SanthiParakal133 Jun 12, 2023
ef793ff
Add Decisions Card Now Displays Special Issues (#18733)
Dev-KRedd Jun 12, 2023
ca245f8
Checkboxes now persist when user clicks cancel (#18758)
Dev-KRedd Jun 13, 2023
9b649a9
Hid MST/PACT checboxes for HLR and SC (#18757)
Kevma50287 Jun 13, 2023
8e3a30e
Fix: only users with edit privileges (#18761)
wmedders21 Jun 13, 2023
ab4c969
HunJerBAH/APPEALS-7497 Feature Toggle Update (#18737)
HunJerBAH Jun 13, 2023
85edd7a
added mst/pact methods for ratings contentions (#18762)
HunJerBAH Jun 13, 2023
d2075a1
created SpecialIssueEditTeam for task assignment (#18763)
HunJerBAH Jun 13, 2023
56d4a46
HunJerBAH/APPEALS-23259 (#18769)
HunJerBAH Jun 13, 2023
86e439a
VBMS Core issue fix (#18776)
youfoundmanesh Jun 13, 2023
625e794
fix modal (#18780)
IsaiahBar Jun 14, 2023
dea3fa7
Fix: flash success message after legacy appeal MST/Pact update. (#18775)
wmedders21 Jun 14, 2023
903d3dc
Ki/APPEALS-23697 - Add MST and PACT Badges to Schedule Veterans Waiti…
KiMauVA Jun 14, 2023
72f3747
Destroy RequestIssuesUpdate instance if @error_code :no_changes (#18779)
wmedders21 Jun 14, 2023
6eedfc2
JHoang/APPEALS-23883 (#18755)
jonathanh-va Jun 14, 2023
f57e7f1
Added line to refresh legacyappeal issues
Kevma50287 Jun 14, 2023
15f220a
Added check for legacy appeals
Kevma50287 Jun 14, 2023
35c2d17
Bugfix: Intake admin can't edit special issues designation (#18794)
Kevma50287 Jun 15, 2023
c3f9a8d
Fix: allow description to pass to IssuesUpdateTask task instructions …
wmedders21 Jun 15, 2023
72fc8d4
Update backend banner logic (#18807)
Kevma50287 Jun 16, 2023
b7adf85
disabling feature toggle covering justification (#18806)
sulak-j Jun 16, 2023
7ed7f60
Khalin/appeals 24109 (#18816)
Dev-KRedd Jun 20, 2023
ff270d0
Fixed banner error on save edit issues (#18829)
Kevma50287 Jun 20, 2023
7777ac7
Fix: mail intake can no longer see mst/pact chkbx on intake radio fie…
wmedders21 Jun 20, 2023
b781099
get vbms core contentions by participant id and updated bgs gem (#18791)
kristeja Jun 20, 2023
9fcda13
Merge branch 'master' into feature/APPEALS-17497
kristeja Jun 20, 2023
ca5ac5e
APPEALS-24294 & APPEALS-24295 vbms ratings issues fix
kristeja Jun 20, 2023
443c7fd
Ki/APPEALS-24160 MST/PACT Issues - Hearings Details Worksheet (#18833)
KiMauVA Jun 21, 2023
aed8c35
APPEALS-24294 & APPEALS-24295 vbms ratings special issues spistn typo…
kristeja Jun 21, 2023
b4c9377
Merge remote-tracking branch 'origin/feature/APPEALS-17497' into feat…
kristeja Jun 21, 2023
b72b5f0
updated bgs gem to use ref
kristeja Jun 21, 2023
d19503d
updated gemfile lock
kristeja Jun 21, 2023
89d4abc
Handling the format description text
youfoundmanesh Jun 21, 2023
3950af4
Nil checking on format_description_text
wmedders21 Jun 21, 2023
ae08ae0
Update MST Badage color
youfoundmanesh Jun 22, 2023
cb2d167
Fix mst pact flash edit message (#18846)
Kevma50287 Jun 22, 2023
7520429
added logic to handle multiple rating profiles with rating decision s…
kristeja Jun 23, 2023
8f5dc11
Fix: prepopulated from vbms checkboxes (#18849)
wmedders21 Jun 23, 2023
04b3182
Will/appeals 24373 (#18840)
wmedders21 Jun 23, 2023
7c5f3d5
MST Badge color update
youfoundmanesh Jun 23, 2023
67e5071
fix for banner
Jun 23, 2023
85fd167
changed logic to check for mst/pact changes
Jun 23, 2023
511f080
Added the updated case.rb and seed_legacy_appeals.rake files.
Rnmarshall93 Jun 23, 2023
cb8debb
updates case.rb for models and generators
Rnmarshall93 Jun 23, 2023
e38b2c2
KevMa/APPEALS-24401 - Decision issues incorrect rendering of special …
KiMauVA Jun 26, 2023
5961344
Merge branch 'master' into feature/APPEALS-17497
kristeja Jun 27, 2023
5083e5c
update verbiage for als rating to identify special issue as pact
kristeja Jun 27, 2023
968e624
Refactor format_description_text (#18868)
wmedders21 Jun 27, 2023
e05d696
APPEALS-24590 added logic to handle an edge case mapping dissn to pul…
kristeja Jun 28, 2023
20f024d
APPEALS-24590 updated rating issue method logic in rating model
kristeja Jun 28, 2023
a5b0688
Will/appeals 24129 benefit type (#18887)
wmedders21 Jun 28, 2023
0a69610
Will/appeals 24663 (#18890)
wmedders21 Jun 28, 2023
9b93345
Merge branch 'master' into feature/APPEALS-17497
kristeja Jun 29, 2023
4bd792a
APPEALS-24590 updated logic to handle rating decision deserialize spe…
kristeja Jun 29, 2023
1cbd805
APPEALS-24578 update correct verbiage
kristeja Jun 29, 2023
ea5aa5c
HunJerBAH/APPEALS-23698 (#18748)
HunJerBAH Jun 29, 2023
39831c9
initial commit (#18901)
jonathanh-va Jun 29, 2023
6645081
APPEALS-24590 fix to get rba contention data
kristeja Jun 29, 2023
c7903bf
Feature Tests Legacy Queue Workflow (#18904)
Kevma50287 Jun 30, 2023
206cf73
Will/appeals 22928 vbms (#18906)
wmedders21 Jun 30, 2023
196c3b4
Merge branch 'master' into feature/APPEALS-17497
kristeja Jun 30, 2023
1b35fc9
APPEALS-24578 fix pact special issues verbiage
kristeja Jun 30, 2023
ed7206c
HunJerBAH legacy seed script edits (#18913)
HunJerBAH Jun 30, 2023
d4a563a
Will/appeals 24807 (#18911)
wmedders21 Jul 2, 2023
130990b
APPEALS-24844 update core contention pact special issues verbiage
kristeja Jul 3, 2023
b6b66b1
HunJerBAH/APPEALS-24844 (#18923)
HunJerBAH Jul 3, 2023
b0b4f49
added 3 issues to the legacy generator (#18927)
HunJerBAH Jul 3, 2023
48d6ea4
Enable feature toggle (#18924)
SanthiParakal133 Jul 5, 2023
a257576
JHoang-17497 rspec fixes (#18926)
jonathanh-va Jul 5, 2023
4a6ccbb
Add issues spec updating failing feature tests. (#18929)
wmedders21 Jul 5, 2023
233e787
added logic to have decision special issues go to cavc remand (#18931)
HunJerBAH Jul 5, 2023
bf56678
added incrementing vacols id numbers to seed script (#18937)
HunJerBAH Jul 5, 2023
a4b7278
APPEALS-24844 updated contention pact special issues constant
kristeja Jul 5, 2023
0bb6947
Request Issue Model spec test fix (#18940)
Kevma50287 Jul 6, 2023
289de11
JHoang-17497-rspec-fixes 2 (#18941)
jonathanh-va Jul 6, 2023
a2a656e
fix special issues display on review remand reasons for ama appeal (#…
jonathanh-va Jul 6, 2023
be2fd48
All tests passing (#18946)
wmedders21 Jul 6, 2023
102e913
Refactor IssueUpdater#create_issues_update_task (#18951)
wmedders21 Jul 6, 2023
df247af
Merge branch 'master' into feature/APPEALS-17497
kristeja Jul 6, 2023
41ad030
Updated appeals and issues controllers to reposition benefit type. (#…
Blake-Manus Jul 6, 2023
551702c
Appeals 24989 - MST/PACT Badge Rendering during Judge decision review…
Kevma50287 Jul 6, 2023
3f51eb8
HunJerBAH/APPEALS-25107 (#18964)
HunJerBAH Jul 7, 2023
30c582d
Merge branch 'master' into feature/APPEALS-17497
kristeja Jul 10, 2023
fd28618
appeals 25076 (#18975)
Blake-Manus Jul 10, 2023
528eeb0
Fixed failing rspecs (#18978)
Kevma50287 Jul 10, 2023
4262284
IssuesUpdateTask model Rspecs updated for format_instructions (#18921)
Kevma50287 Jul 10, 2023
54d429b
HunJerBAH/APPEALS-25276 (#18979)
HunJerBAH Jul 10, 2023
6b67f3e
HunJerBAH/APPEALS-25131 and APPEALS-25275 (#18973)
HunJerBAH Jul 10, 2023
6be56f7
JHoang-17497-rspec-fixes-3 (#18963)
jonathanh-va Jul 10, 2023
4305d22
Changed comparison to handle more than 10 records being present. (#18…
Rnmarshall93 Jul 10, 2023
5d1fab4
Fixed tests on ama_queue_spec.rb (#18967)
wmedders21 Jul 10, 2023
5ab000a
Removed redundant test because a more complete test for this exists i…
Rnmarshall93 Jul 10, 2023
8285baa
mock mst and pact on vacolsissue (#18957)
SanthiParakal133 Jul 10, 2023
9282bcc
HunJerBAH APPEALS-25283 (#18980)
HunJerBAH Jul 11, 2023
1131c75
update the spec with decision review from response (#18969)
SanthiParakal133 Jul 11, 2023
2a20bd2
Ratings fix (#18985)
youfoundmanesh Jul 11, 2023
f9230c6
nil handling fix
kristeja Jul 12, 2023
959bcc2
added handling for nil, single contention, and array of contentions i…
HunJerBAH Jul 13, 2023
43199c9
Khalin/appeals 22929 (#18989)
Dev-KRedd Jul 13, 2023
379ff92
JHoang/17497-rspec-fixes-4 (#18994)
jonathanh-va Jul 13, 2023
675325c
Merge branch 'master' into feature/APPEALS-17497
kristeja Jul 13, 2023
6fec32a
updated bgs gem with latest ref
kristeja Jul 13, 2023
c192aed
Merge branch 'master' into feature/APPEALS-17497
kristeja Jul 13, 2023
930a8ec
Merge branch 'master' into feature/APPEALS-17497
kristeja Jul 17, 2023
965e712
Merge branch 'master' into feature/APPEALS-17497
kristeja Jul 17, 2023
1a8d0fb
Merge branch 'master' into feature/APPEALS-17497
kristeja Jul 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gem "acts_as_tree"
gem "amoeba"
# BGS

gem "bgs", git: "https://github.com/department-of-veterans-affairs/ruby-bgs.git", ref: "7d7c67f7bad5e5aa03e257f0d8e57a4aa1a6cbbf"
gem "bgs", git: "https://github.com/department-of-veterans-affairs/ruby-bgs.git", ref: "5f47e7b2656ef347d314ef43c93d38a9f20816ec"
# Bootsnap speeds up app boot (and started to be a default gem in 5.2).
gem "bootsnap", require: false
gem "browser"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ GIT

GIT
remote: https://github.com/department-of-veterans-affairs/ruby-bgs.git
revision: 7d7c67f7bad5e5aa03e257f0d8e57a4aa1a6cbbf
ref: 7d7c67f7bad5e5aa03e257f0d8e57a4aa1a6cbbf
revision: 5f47e7b2656ef347d314ef43c93d38a9f20816ec
ref: 5f47e7b2656ef347d314ef43c93d38a9f20816ec
specs:
bgs (0.2)
bgs (0.3)
httpclient
nokogiri (>= 1.11.0.rc4)
savon (~> 2.12)
Expand Down
250 changes: 237 additions & 13 deletions app/controllers/appeals_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def show

def edit
# only AMA appeals may call /edit
return not_found if appeal.is_a?(LegacyAppeal)
# this was removed for MST/PACT initiative to edit MST/PACT for legacy issues
return not_found if appeal.is_a?(LegacyAppeal) && !FeatureToggle.enabled?(:legacy_mst_pact_identification)
end

helper_method :appeal, :url_appeal_uuid
Expand All @@ -178,18 +179,11 @@ def url_appeal_uuid
end

def update
if request_issues_update.perform!
# if cc appeal, create SendInitialNotificationLetterTask
if appeal.contested_claim? && FeatureToggle.enabled?(:cc_appeal_workflow)
# check if an existing letter task is open
existing_letter_task_open = appeal.tasks.any? do |task|
task.class == SendInitialNotificationLetterTask && task.status == "assigned"
end
# create SendInitialNotificationLetterTask unless one is open
send_initial_notification_letter unless existing_letter_task_open
end

if appeal.is_a?(LegacyAppeal) && FeatureToggle.enabled?(:legacy_mst_pact_identification)
legacy_mst_pact_updates
elsif request_issues_update.perform!
set_flash_success_message
create_subtasks!

render json: {
beforeIssues: request_issues_update.before_issues.map(&:serialize),
Expand All @@ -203,6 +197,18 @@ def update

private

def create_subtasks!
# if cc appeal, create SendInitialNotificationLetterTask
if appeal.contested_claim? && FeatureToggle.enabled?(:cc_appeal_workflow)
# check if an existing letter task is open
existing_letter_task_open = appeal.tasks.any? do |task|
task.class == SendInitialNotificationLetterTask && task.status == "assigned"
end
# create SendInitialNotificationLetterTask unless one is open
send_initial_notification_letter unless existing_letter_task_open
end
end

# :reek:DuplicateMethodCall { allow_calls: ['result.extra'] }
# :reek:FeatureEnvy
def render_search_results_as_json(result)
Expand Down Expand Up @@ -270,7 +276,226 @@ def review_edited_message
"You have successfully " + [added_issues, removed_issues, withdrawn_issues].compact.to_sentence + "."
end

# check if changes in params
def mst_pact_changes?
request_issues_update.mst_edited_issues.any? || request_issues_update.pact_edited_issues.any?
end

# format MST/PACT edit success banner message
def mst_and_pact_edited_issues
# list of edit counts
mst_added = 0
mst_removed = 0
pact_added = 0
pact_removed = 0
# get edited issues from params and reject new issues without id
if !appeal.is_a?(LegacyAppeal)
existing_issues = params[:request_issues].reject { |i| i[:request_issue_id].nil? }

# get added issues
new_issues = request_issues_update.after_issues - request_issues_update.before_issues
# get removed issues
removed_issues = request_issues_update.before_issues - request_issues_update.after_issues

# calculate edits
existing_issues.each do |issue_edit|
# find the original issue and compare MST/PACT changes
before_issue = request_issues_update.before_issues.find { |i| i.id == issue_edit[:request_issue_id].to_i }

# increment edit counts if they meet the criteria for added/removed
mst_added += 1 if issue_edit[:mst_status] != before_issue.mst_status && issue_edit[:mst_status]
mst_removed += 1 if issue_edit[:mst_status] != before_issue.mst_status && !issue_edit[:mst_status]
pact_added += 1 if issue_edit[:pact_status] != before_issue.pact_status && issue_edit[:pact_status]
pact_removed += 1 if issue_edit[:pact_status] != before_issue.pact_status && !issue_edit[:pact_status]
end
else
existing_issues = legacy_issue_params[:request_issues]
existing_issues.each do |issue_edit|
mst_added += 1 if legacy_issues_with_updated_mst_pact_status[:mst_edited].include?(issue_edit) && issue_edit[:mst_status]
mst_removed += 1 if legacy_issues_with_updated_mst_pact_status[:mst_edited].include?(issue_edit) && !issue_edit[:mst_status]
pact_added += 1 if legacy_issues_with_updated_mst_pact_status[:pact_edited].include?(issue_edit) && issue_edit[:pact_status]
pact_removed += 1 if legacy_issues_with_updated_mst_pact_status[:pact_edited].include?(issue_edit) && !issue_edit[:pact_status]
new_issues = []
removed_issues = []
end
end

# return if no edits, removals, or additions
return if (mst_added + mst_removed + pact_added + pact_removed == 0) && removed_issues.empty? && new_issues.empty?

message = []

message << "#{pact_removed} #{'issue'.pluralize(pact_removed)} unmarked as PACT" unless pact_removed == 0
message << "#{mst_removed} #{'issue'.pluralize(mst_removed)} unmarked as MST" unless mst_removed == 0
message << "#{mst_added} #{'issue'.pluralize(mst_added)} marked as MST" unless mst_added == 0
message << "#{pact_added} #{'issue'.pluralize(pact_added)} marked as PACT" unless pact_added == 0

# add in removed message and added message, if any
message << create_mst_pact_message_for_new_and_removed_issues(new_issues, "added") unless new_issues.empty?
message << create_mst_pact_message_for_new_and_removed_issues(removed_issues, "removed") unless removed_issues.empty?

message.flatten
end

# create MST/PACT message for added/removed issues
def create_mst_pact_message_for_new_and_removed_issues(issues, type)
special_issue_message = []
# check if any added/removed issues have MST/PACT and get the count
mst_count = issues.count { |issue| issue.mst_status && !issue.pact_status }
pact_count = issues.count { |issue| issue.pact_status && !issue.mst_status }
both_count = issues.count { |issue| issue.pact_status && issue.mst_status }
none_count = issues.count { |issue| !issue.pact_status && !issue.mst_status }

special_issue_message << "#{mst_count} #{'issue'.pluralize(mst_count)} with MST #{type}" unless mst_count == 0
special_issue_message << "#{pact_count} #{'issue'.pluralize(pact_count)} with PACT #{type}" unless pact_count == 0
special_issue_message << "#{both_count} #{'issue'.pluralize(both_count)} with MST and PACT #{type}" unless both_count == 0
special_issue_message << "#{none_count} #{'issue'.pluralize(none_count)} #{type}" unless none_count == 0

special_issue_message
end

# check if there is a change in mst/pact on legacy issue
# if there is a change, creat an issue update task
def legacy_mst_pact_updates
legacy_issue_params[:request_issues].each do |current_issue|
issue = appeal.issues.find { |i| i.vacols_sequence_id == current_issue[:vacols_sequence_id].to_i }

# Check for changes in mst/pact status
if issue.mst_status != current_issue[:mst_status] || issue.pact_status != current_issue[:pact_status]
# If there is a change :
# Create issue_update_task to populate casetimeline if there is a change
create_legacy_issue_update_task(issue, current_issue)

# Grab record from Vacols database to issue.
# When updating an Issue, method in IssueMapper and IssueRepo requires the attrs show below in issue_attrs:{}
record = VACOLS::CaseIssue.find_by(isskey: appeal.vacols_id, issseq: current_issue[:vacols_sequence_id])
Issue.update_in_vacols!(
vacols_id: appeal.vacols_id,
vacols_sequence_id: current_issue[:vacols_sequence_id],
issue_attrs: {
mst_status: current_issue[:mst_status] ? "Y" : "N",
pact_status: current_issue[:pact_status] ? "Y" : "N",
program: record[:issprog],
issue: record[:isscode],
level_1: record[:isslev1],
level_2: record[:isslev2],
level_3: record[:isslev3]
}
)
end
end
set_flash_mst_edit_message
render json: { issues: json_issues }, status: :ok
end

def json_issues
appeal.issues.map do |issue|
::WorkQueue::LegacyIssueSerializer.new(issue).serializable_hash[:data][:attributes]
end
end

def legacy_issues_with_updated_mst_pact_status
mst_edited = legacy_issue_params[:request_issues].find_all do |current_issue|
issue = appeal.issues.find { |i| i.vacols_sequence_id == current_issue[:vacols_sequence_id].to_i }
issue.mst_status != current_issue[:mst_status]
end
pact_edited = legacy_issue_params[:request_issues].find_all do |current_issue|
issue = appeal.issues.find { |i| i.vacols_sequence_id == current_issue[:vacols_sequence_id].to_i }
issue.pact_status != current_issue[:pact_status]
end
{mst_edited: mst_edited, pact_edited: pact_edited}
end

def legacy_issue_params
# Checks the keys for each object in request_issues array
request_issue_params = params.require("request_issues").each do |current_param|
current_param.permit(:request_issue_id,
:withdrawal_date,
:vacols_sequence_id,
:mst_status,
:pact_status,
:mst_status_update_reason_notes,
:pact_status_update_reason_notes).to_h
end

# After check, recreate safe_params object and include vacols_uniq_id
safe_params = {
request_issues: request_issue_params,
vacols_user_id: current_user.vacols_uniq_id
}
safe_params
end

def create_params
legacy_issue_params.merge(vacols_id: appeal.vacols_id)
end

def create_legacy_issue_update_task(before_issue, current_issue)
user = RequestStore[:current_user]

# close out any tasks that might be open
open_issue_task = Task.where(
assigned_to: SpecialIssueEditTeam.singleton
).where(status: "assigned").where(appeal: appeal)
open_issue_task[0].delete unless open_issue_task.empty?

task = IssuesUpdateTask.create!(
appeal: appeal,
parent: appeal.root_task,
assigned_to: SpecialIssueEditTeam.singleton,
assigned_by: user,
completed_by: user
)
# format the task instructions and close out
task.format_instructions(
"Edited Issue",
[
"Benefit Type: #{before_issue.labels[0]}\n",
"Issue: #{before_issue.labels[1..-2].join("\n")}\n",
"Code: #{[before_issue.codes[-1], before_issue.labels[-1]].join(" - ")}\n",
"Note: #{before_issue.note}\n",
"Disposition: #{before_issue.readable_disposition}\n"
].compact.join("\r\n"),
"",
before_issue.mst_status,
before_issue.pact_status,
current_issue[:mst_status],
current_issue[:pact_status]
)
task.completed!

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

# updated flash message to show mst/pact message if mst/pact changes (not to legacy)
def set_flash_success_message
return set_flash_mst_edit_message if mst_pact_changes? &&
(FeatureToggle.enabled?(:mst_identification) ||
FeatureToggle.enabled?(:pact_identification))

set_flash_edit_message
end

# create success message with added and removed issues
def set_flash_mst_edit_message
flash[:mst_pact_edited] = mst_and_pact_edited_issues
end

def set_flash_edit_message
flash[:edited] = if request_issues_update.after_issues.empty?
review_removed_message
elsif (request_issues_update.after_issues - request_issues_update.withdrawn_issues).empty?
Expand Down Expand Up @@ -395,4 +620,3 @@ def get_appeal_object(appeals_id)
end
end
end

7 changes: 5 additions & 2 deletions app/controllers/case_reviews_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def set_application
end

def complete
result = CompleteCaseReview.new(case_review_class: case_review_class, params: complete_params).call

new_complete_case_review = CompleteCaseReview.new(case_review_class: case_review_class, params: complete_params)
result = new_complete_case_review.call
if result.success?
case_review = result.extra[:case_review]
render json: {
Expand Down Expand Up @@ -74,13 +74,16 @@ def judge_case_review_params

def issues_params
# This is a combined list of params for ama and legacy appeals
# Reprsents the information the front end is sending to create a decision issue object
[
:id,
:disposition,
:description,
:readjudication,
:benefit_type,
:diagnostic_code,
:mst_status,
:pact_status,
request_issue_ids: [],
remand_reasons: [
:code,
Expand Down
7 changes: 6 additions & 1 deletion app/controllers/intakes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class IntakesController < ApplicationController

def index
no_cache

respond_to do |format|
format.html { render(:index) }
end
Expand Down Expand Up @@ -43,6 +42,7 @@ def destroy
def review
if intake.review!(params)
render json: intake.ui_hash

else
render json: { error_codes: intake.review_errors }, status: :unprocessable_entity
end
Expand Down Expand Up @@ -97,6 +97,7 @@ def index_props
{
userDisplayName: current_user.display_name,
userCanIntakeAppeals: current_user.can_intake_appeals?,
userCanEditIntakeIssues: current_user.can_edit_intake_issues?,
serverIntake: intake_ui_hash,
dropdownUrls: dropdown_urls,
applicationUrls: application_urls,
Expand Down Expand Up @@ -150,6 +151,10 @@ def feature_toggle_ui_hash
filedByVaGovHlr: FeatureToggle.enabled?(:filed_by_va_gov_hlr, user: current_user),
updatedIntakeForms: FeatureToggle.enabled?(:updated_intake_forms, user: current_user),
eduPreDocketAppeals: FeatureToggle.enabled?(:edu_predocket_appeals, user: current_user),
mstIdentification: FeatureToggle.enabled?(:mst_identification, user: current_user),
pactIdentification: FeatureToggle.enabled?(:pact_identification, user: current_user),
legacyMstPactIdentification: FeatureToggle.enabled?(:legacy_mst_pact_identification, user: current_user),
justificationReason: FeatureToggle.enabled?(:justification_reason, user: current_user),
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)
Expand Down
Loading
Loading