-
Notifications
You must be signed in to change notification settings - Fork 72
95912 Check most recent status prior to sending ZSF email + update test coverage - IVC CHAMPVA forms #20044
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
95912 Check most recent status prior to sending ZSF email + update test coverage - IVC CHAMPVA forms #20044
Conversation
…-check-most-recent-status-prior-to-sending-zsf-email
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Keep |
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Keep |
…ts-api into 95912-check-most-recent-status-prior-to-sending-zsf-email
batches = get_nil_batches | ||
batches = missing_status_cleanup.get_missing_statuses(silent: true) |
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 batch fetching functionality was added as part of the new MissingStatusCleanup
class, so replacing this get_nil_batches
usage with that shared class.
# @param [boolean] silent whether or not to `puts` the batch information | ||
# | ||
# @returns [Hash] a hash where keys are form UUIDs and values are arrays of | ||
# IvcChampvaForm records matching that UUID | ||
def get_missing_statuses | ||
def get_missing_statuses(silent: false) | ||
all_nil_statuses = IvcChampvaForm.where(pega_status: nil) | ||
batches = batch_records(all_nil_statuses) | ||
|
||
return batches if silent | ||
|
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.
Updated get_missing_statuses
and get_batches_for_email
methods so that printing to console can be silenced (improves unit test output readability, etc)
puts "Setting #{form.file_name} to 'Manually Processed'" | ||
# In this context, `form.file_name` has this structure: "#{uuid}_#{form_id}_supporting_doc-#{index}.pdf" | ||
Rails.logger.info("IVC ChampVA Forms - Setting #{form.file_name} to 'Manually Processed'") |
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.
Changing this puts
to an actual logger call in case we want to track this in Data Dog later.
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.
Updated to reflect that the API now includes "UUID" as a field in responses.
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.
Looks good!
Summary
This PR adds functionality to allow the
MissingFormStatusJob
to verify form submissions with missing PEGA status against the PEGA reporting API. This provides one extra layer of confidence when determining whether or not to send the user a Zero Silent Failure email.Additionally, this PR adds some new unit tests, updates some test data, and does some minor refactoring of the code that makes up the
MissingFormStatusJob
workflow.Related issue(s)
Testing done
Screenshots
NA
What areas of the site does it impact?
IVC CHAMPVA forms
Acceptance criteria
Requested Feedback
NA