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

Raymond/Appeals-24777 #18872

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3e45a15
Adding initial remediation script as per APPEALS-23500
raymond-hughes Jun 5, 2023
dc621b2
Adding spec and updating script accordingly.
raymond-hughes Jun 7, 2023
09cb830
Adding initial remediation script as per APPEALS-23500
raymond-hughes Jun 5, 2023
56d1643
Adding spec and updating script accordingly.
raymond-hughes Jun 7, 2023
26064ce
Merge branch 'Raymond/APPEALS-23501' of github.com:department-of-vete…
raymond-hughes Jun 26, 2023
7c7e982
Updating spec for POA Access
raymond-hughes Jun 26, 2023
a6dcf73
Update poa access script to corrctly represent a claimants pid so we …
raymond-hughes Jun 27, 2023
e3908c1
Update spec to correctly build a new poa and use the new poa's pid in…
raymond-hughes Jun 27, 2023
d658f62
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jun 27, 2023
fe9e47e
Remove purge_poa! method and roll into run as inline code.
raymond-hughes Jun 27, 2023
e1e2c37
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jun 28, 2023
f6ebfb5
Update lib/helpers/poa_access.rb
raymond-hughes Jun 29, 2023
77d3534
Update lib/helpers/poa_access.rb
raymond-hughes Jun 29, 2023
9a6f4b2
Update lib/helpers/poa_access.rb
raymond-hughes Jun 29, 2023
503a0a4
Update spec/lib/helpers/poa_access_spec.rb
raymond-hughes Jun 29, 2023
cc8ed1b
Update to spec to remove POA interrupt check.
raymond-hughes Jun 30, 2023
680e259
Finalize POA test
raymond-hughes Jun 30, 2023
5ce0823
🚨 Address Reek smell: WarRoom::PoaAccess assumes too much for instanc…
jcroteau Jul 1, 2023
936f1ed
🚨 Address Reek smell: Line is too long. [121/120]
jcroteau Jul 1, 2023
465851f
🚨 Address Reek smell: Place the . on the next line, together with the…
jcroteau Jul 1, 2023
f9e1a57
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jul 7, 2023
de3f1f8
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jul 10, 2023
77570f9
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jul 12, 2023
5c343fd
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jul 17, 2023
435388d
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jul 17, 2023
3abd884
Update script to check for new poa created and avoid checking poa thr…
raymond-hughes Jul 17, 2023
3f54ae0
Updating POA job
raymond-hughes Jul 17, 2023
6338aef
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jul 18, 2023
546b70f
Merge branch 'hotfix/APPEALS-25321-and-APPEALS-25955' into uat/FY23Q4…
ThorntonMatthew Jul 20, 2023
55f68e0
Merge remote-tracking branch 'origin/hotfix/APPEALS-14895' into uat/F…
ThorntonMatthew Jul 20, 2023
8e3847f
Merge branch 'uat/FY23Q4.1.2' into dev-support/slack-notifications-ch…
zurbergram Jul 20, 2023
95d9e37
Remove cache clear as its used in bgs poa call and is redundant in th…
raymond-hughes Jul 21, 2023
cd406f5
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jul 21, 2023
370fe86
Merge pull request #19037 from department-of-veterans-affairs/dev-sup…
zurbergram Jul 21, 2023
f93d1bc
Merge branch 'uat/FY23Q4.1.2' into HunJerBAH/feature/APPEALS-17497-v1…
HunJerBAH Jul 21, 2023
d678987
Merge pull request #19045 from department-of-veterans-affairs/HunJerB…
HunJerBAH Jul 21, 2023
0456971
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Jul 31, 2023
9047448
Merge branch 'Raymond/APPEALS-23501' of github.com:department-of-vete…
raymond-hughes Jul 31, 2023
ff85cc7
Merge branch 'uat/FY23Q4.1.2' into Raymond/APPEALS-23501
raymond-hughes Aug 1, 2023
c321954
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Aug 1, 2023
1e756dc
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Aug 2, 2023
2c84f18
Merge branch 'master' into Raymond/APPEALS-23501
raymond-hughes Dec 29, 2023
18be089
Update workflow.yml
raymond-hughes Dec 29, 2023
102d6ff
Update workflow.yml
raymond-hughes Dec 29, 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
36 changes: 36 additions & 0 deletions lib/helpers/poa_access.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

# When POA is not accessible some users see an error on frontend.
# Others will see a blank POA and when refreshed the POA will still show empty
# The root cause is no person record and we solve this by grabbing
# a new person record and creating the BGS POA if needed.
module WarRoom
class PoaAccess
# Legacy Appeals - no POA access when spouse not in people table
#
# @param vacols_id [String] VACOLS id for Legacy Appeal
# @param claimant_participant_id [String] participant ID of spouse
# @return [true, false] whether the fix was successful
def initialize(vacols_id, claimant_participant_id)
@vacols_id = vacols_id
@claimant_participant_id = claimant_participant_id
RequestStore[:current_user] = User.system_user
end

def run
# Create person record
Person.find_or_create_by_participant_id(@claimant_participant_id)

# Create bgs POA record
# NOTE: The POA is updated in a before_save callback. It will pull in all data for the created POA
BgsPowerOfAttorney.find_or_create_by_claimant_participant_id(@claimant_participant_id)

# Confirm fix by returning the POA for passed in appeal
legacy_appeal.bgs_power_of_attorney.present?
jcroteau marked this conversation as resolved.
Show resolved Hide resolved
end

def legacy_appeal
LegacyAppeal.find_by!(vacols_id: @vacols_id)
end
raymond-hughes marked this conversation as resolved.
Show resolved Hide resolved
end
end
24 changes: 24 additions & 0 deletions spec/lib/helpers/poa_access_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

require "helpers/poa_access"

describe "WarRoom::PoaAccess" do
let!(:legacy_appeal) { create(:legacy_appeal, vacols_case: create(:case)) }
let!(:poa) { create(:bgs_power_of_attorney) }

context "when run against a legacy appeal" do
it "creates a person record" do
# To avoid adding to the large amount of dummy data lets just coerce the record to be :not_found
allow_any_instance_of(BgsPowerOfAttorney).to receive(:bgs_record).and_return(:not_found)

expect(Person).to receive(:find_or_create_by_participant_id).with(poa.claimant_participant_id)

expect(BgsPowerOfAttorney).to receive(:find_or_create_by_claimant_participant_id)
.with(poa.claimant_participant_id)

remediation_success = WarRoom::PoaAccess.new(legacy_appeal.vacols_id, poa.claimant_participant_id).run

expect(remediation_success).to be true
end
end
end