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

[DBX-82245] implement LH getPDF for 526 backup path #16876

Merged
merged 39 commits into from
Jun 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1921f39
[DBX-82245] implement LH getPDF for 526 backup path
SamStuckey May 24, 2024
b44f041
add spec
SamStuckey Jun 5, 2024
307566e
general save
SamStuckey Jun 6, 2024
0a4a6b8
add TREX debug to gitignore
SamStuckey Jun 6, 2024
87f89eb
general save
SamStuckey Jun 6, 2024
3927c2b
creating broken pdf successfully?
SamStuckey Jun 6, 2024
8f62466
general save
SamStuckey Jun 6, 2024
b4199cc
Notate for handoff
SamStuckey Jun 10, 2024
62d2d9d
removing flipper and refactoring to support both providers
tblackwe Jun 12, 2024
02a43bc
improved conditional
tblackwe Jun 12, 2024
7718ab8
remove accidental schema changes
SamStuckey Jun 12, 2024
a4441a4
cleanup
tblackwe Jun 12, 2024
bf91385
removing wip comment
tblackwe Jun 12, 2024
74d1b1f
do you want to know the worst thing about infinite loops?
tblackwe Jun 12, 2024
1cd3bca
whitespace
tblackwe Jun 12, 2024
6874803
Merge branch 'master' into dbx-82245/implement-backup-submission-lh-a…
tblackwe Jun 12, 2024
22b887c
rubocop mad
tblackwe Jun 12, 2024
3f78fc9
[DBX-82245] implement LH getPDF for 526 backup path
SamStuckey May 24, 2024
db4a642
add spec
SamStuckey Jun 5, 2024
c9a0f66
general save
SamStuckey Jun 6, 2024
44ec8c5
add TREX debug to gitignore
SamStuckey Jun 6, 2024
2bc523e
general save
SamStuckey Jun 6, 2024
1168604
creating broken pdf successfully?
SamStuckey Jun 6, 2024
ad2dcb9
general save
SamStuckey Jun 6, 2024
7eb38e7
Notate for handoff
SamStuckey Jun 10, 2024
99bc364
removing flipper and refactoring to support both providers
tblackwe Jun 12, 2024
8ff8c3a
improved conditional
tblackwe Jun 12, 2024
611c6d6
remove accidental schema changes
SamStuckey Jun 12, 2024
43d11db
cleanup
tblackwe Jun 12, 2024
ef19cc1
removing wip comment
tblackwe Jun 12, 2024
fb0c816
do you want to know the worst thing about infinite loops?
tblackwe Jun 12, 2024
cdabb04
whitespace
tblackwe Jun 12, 2024
8098340
rubocop mad
tblackwe Jun 12, 2024
ef99475
Merge branch 'dbx-82245/implement-backup-submission-lh-api-factory' o…
tblackwe Jun 12, 2024
1f15692
fixing gemlock
tblackwe Jun 12, 2024
b0eff5f
rubocop less mad
tblackwe Jun 12, 2024
da522e3
some changes from review
tblackwe Jun 13, 2024
560bc3c
fixed test
tblackwe Jun 13, 2024
a727b5c
Merge branch 'master' into dbx-82245/implement-backup-submission-lh-a…
tblackwe Jun 13, 2024
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
Prev Previous commit
Next Next commit
add spec
SamStuckey committed Jun 12, 2024
commit b44f041fa126ce43e8242e16e291edeabf2fb43f
Original file line number Diff line number Diff line change
@@ -120,8 +120,6 @@ def upload_pdf_submission_to_s3(return_url: false, url_life_length: 1.week.to_i)
generate_zip_and_upload(params_docs, zipname, metadata, return_url, url_life_length)
end

private

def instantiate_upload_info_from_lighthouse
initial_upload = @lighthouse_service.get_location_and_uuid
@initial_upload_uuid = initial_upload[:uuid]
@@ -435,16 +433,11 @@ def choose_provider(headers, breakered: true)
options: { auth_headers: headers, breakered: },
current_user: OpenStruct.new({ flipper_id: submission.user_uuid }),
feature_toggle: ApiProviderFactory::FEATURE_TOGGLE_GENERATE_PDF,
icn: user_account.icn
icn: Account.lookup_by_user_uuid(submission.user_uuid)&.icn
)
end
end

def user_account
@user_account ||= UserAccount.find_by(id: submission.user_account_id) ||
Account.find_by(idme_uuid: submission.user_uuid)
end

class NonBreakeredProcessor < Processor
def get_form526_pdf
headers = submission.auth_headers
Original file line number Diff line number Diff line change
@@ -28,23 +28,23 @@
end

describe '#choose_provider' do
let(:submission) { create(:form526_submission) }
# [wipn8923] ?? submissionn has a user_uuid, but what type of record is it?
# let(:user) { UserAccount.find(submission
let(:account) { create(:account) }
let(:submission) { create(:form526_submission, user_uuid: account.idme_uuid) }

it 'delegates to the ApiProviderFactory with the correct data' do
headers = {}
breakered = true
auth_headers = {}
expect(ApiProviderFactory).to receive(:call).with({
type: ApiProviderFactory::FACTORIES[:generate_pdf],
provider: nil,
options: { auth_headers: headers, breakered: }, # wipn - headers? / breakered?
options: { auth_headers:, breakered: true },
current_user: OpenStruct.new({ flipper_id: submission.user_uuid }),
feature_toggle: ApiProviderFactory::FEATURE_TOGGLE_GENERATE_PDF,
icn: user_account.icn
icn: account.icn
})

subject.new(submission.id).choose_provider(headers, breakered)
subject
.new(submission.id, get_upload_location_on_instantiation: false)
.choose_provider(auth_headers)
tblackwe marked this conversation as resolved.
Show resolved Hide resolved
end
end
end