-
Notifications
You must be signed in to change notification settings - Fork 58
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
API 35932 monthly email show consumers in table #16774
API 35932 monthly email show consumers in table #16774
Conversation
* Updates monthly report to have a row for each consumer in each table * Refactors to share shared methods and templates between the daily and monthly report * Moves shared partials so they are in a central spot between the two templates * Adds a parent base class for the reporting Jobs so they can access thier shared methods * They will still, as sidekiq jobs, also have access to the service_base class * Updates/adjusts tests to handle the new data goiing to monthly submissions email modified: app/models/concerns/kms_encrypted_model_patch.rb modified: modules/claims_api/app/mailers/claims_api/submission_report_mailer.rb modified: modules/claims_api/app/sidekiq/claims_api/report_monthly_submissions.rb modified: modules/claims_api/app/sidekiq/claims_api/report_unsuccessful_submissions.rb new file: modules/claims_api/app/sidekiq/claims_api/reporting_base.rb new file: modules/claims_api/app/views/claims_api/_claims_status_table.html.erb renamed: modules/claims_api/app/views/claims_api/unsuccessful_report_mailer/_ews_errors_table.html.erb -> modules/claims_api/app/views/claims_api/_ews_errors_table.html.erb renamed: modules/claims_api/app/views/claims_api/unsuccessful_report_mailer/_ews_status_table.html.erb -> modules/claims_api/app/views/claims_api/_ews_status_table.html.erb renamed: modules/claims_api/app/views/claims_api/unsuccessful_report_mailer/_itf_status_table.html.erb -> modules/claims_api/app/views/claims_api/_itf_status_table.html.erb new file: modules/claims_api/app/views/claims_api/_monthly_claims_status_table.html.erb renamed: modules/claims_api/app/views/claims_api/unsuccessful_report_mailer/_poa_errors_table.html.erb -> modules/claims_api/app/views/claims_api/_poa_errors_table.html.erb renamed: modules/claims_api/app/views/claims_api/unsuccessful_report_mailer/_poa_status_table.html.erb -> modules/claims_api/app/views/claims_api/_poa_status_table.html.erb renamed: modules/claims_api/app/views/claims_api/unsuccessful_report_mailer/_submission_table.html.erb -> modules/claims_api/app/views/claims_api/_submission_table.html.erb modified: modules/claims_api/app/views/claims_api/submission_report_mailer/submission_report.html.erb deleted: modules/claims_api/app/views/claims_api/unsuccessful_report_mailer/_claims_status_table.html.erb deleted: modules/claims_api/app/views/claims_api/unsuccessful_report_mailer/_counts_table.html.erb modified: modules/claims_api/app/views/claims_api/unsuccessful_report_mailer/unsuccessful_report.html.erb modified: modules/claims_api/spec/mailers/report_monthly_submissions_spec.rb modified: modules/claims_api/spec/sidekiq/report_monthly_submissions_spec.rb modified: spec/mailers/previews/claims_api_submission_report_mailer_preview.rb
Generated by 🚫 Danger |
</tr> | ||
<% end if claims_consumers %> | ||
</tbody> | ||
</table> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason this partial shows up as new is the formatting on the old one was wonky, so when I fixed it and moved it (along with the rest of the shared partials) it identified it as new.
…line count down (planning on adding in a follow up)
created_at: @from..@to, | ||
status: %w[errored] | ||
).order(:cid, :status) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite a few of the line changes stem from this refactor which was in an effort to share the methods being used by both reporting jobs. -117 here and then +125 in the shared reporting_base
file. The only reason I would not make this change would be to avoid the line count warning, however since these are shared methods I believe this change is worth it.
…entages are out for monthly email
end | ||
end | ||
|
||
def monthly_claims_totals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
monthly_claims_totals
is the only new method added in here. The rest of the additions are a refactor because they are shared between the monthly and nightly job now (mentioned above)
errored_evidence_waiver_submissions.push(FactoryBot.create(:claims_api_evidence_waiver_submission, | ||
cid: '0oa9uf05lgXYk6ZXn297')) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values are just refactored from the nightly job test file to be shared for both, nothing new added.
)) | ||
errored_evidence_waiver_submissions.push(FactoryBot.create(:claims_api_evidence_waiver_submission, | ||
cid: '0oa9uf05lgXYk6ZXn297')) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relates to above comment, moved out into a shared file to share between both tests now.
expect(itf_totals[1]['VA Connect Pro'][:errored]).to eq(1) | ||
expect(itf_totals[1]['VA Connect Pro'][:totals]).to eq(2) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with these. These examples are used in both files to validate the metrics, so moved out (unchanged) into a shared examples file.
expect(itf_totals[1]['VA Connect Pro'][:totals]).to eq(2) | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comment for shared examples. Nothing was changed for these examples other then they are shared now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran ClaimsApi::ReportMonthlySubmissions.new.perform
locally in console without issues; reviewed output from preview links for new & refactored templates with dummy data. Looks good!
Summary
Some ACs were previously completed. This PR is cleaning up a missed point, AC #2 which stated to have a row in the tables for each consumer
Related issue(s)
Testing done
Testing Notes
To manually test locally you need to set up a few things
settings.yml
make sureclaims_api.report_enabled
is set totrue
Rails c
Screenshots
Note: Optional
What areas of the site does it impact?
(Refactor. Moved but not modified)
Acceptance criteria
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?