-
Notifications
You must be signed in to change notification settings - Fork 13
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
FYST-1675 Send filer rejection notice if efile errors have handling #5445
base: main
Are you sure you want to change the base?
Conversation
@@ -9,9 +9,10 @@ def perform(submission, transition) | |||
if transition.efile_errors.any?(&:auto_cancel) | |||
submission.transition_to!(:notified_of_rejection) | |||
submission.transition_to!(:cancelled) | |||
elsif transition.efile_errors.all?(&:auto_wait) | |||
submission.transition_to!(:notified_of_rejection) |
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.
in the else
scenario, they remain in rejected
state & see pending
html on return-status
and do not receive any notification (unless they travel further down & have any retry-able error codes).
Technically same pathway for the else
submissions, just different syntax. The main change is the change from :notified_of_rejection
instead of :waiting
pending 'Not implemented' | ||
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.
need to fill this file out before I add my code :(
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.
resuscitating an old file deleted: #4613
Heroku app: https://gyr-review-app-5445-d5c2adb8e07e.herokuapp.com/ |
@@ -48,7 +48,7 @@ | |||
|
|||
trait :for_state do | |||
tax_return {} | |||
data_source { create :state_file_ny_intake } | |||
data_source { create :state_file_az_intake } |
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.
hoping this doesnt catastrophically mess things up
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.
it didnt! had to do a small follow up commit to fix 42ced40
efile_error: @efile_error, | ||
efile_submission_transitions: { most_recent: true, to_state: ["rejected", "failed"] } | ||
) | ||
.pluck(:efile_submission_id) |
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 above block is just me reformatting code to be more readable (in ruby mine)
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.
Nice work! 🎉
let(:failed_submission) { create :efile_submission, :for_state, :failed } | ||
let(:wait_efile_error) { create :efile_error, code: "WAIT-ME-123", auto_wait: true, service_type: :state_file_az } | ||
let(:cancel_efile_error) { create :efile_error, code: "CANCEL-ME-123", auto_cancel: true, service_type: :state_file_az } | ||
let(:not_handled_error) { create :efile_error, code: "NOTHING-ME-123", auto_cancel: false, auto_wait: false, service_type: :state_file_az } |
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.
what is a not handled error? is that just the default error?
end | ||
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.
nice spec! 🎉
context "with nj state efile error" do | ||
let!(:state_efile_error) { create :efile_error, service_type: "state_file_nj" } | ||
it "cannot manage the state efile error" do | ||
expect(subject.can?(:manage, state_efile_error)).to eq false |
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.
maybe out of the scope of this ticket but should there be a test for a user role "StateFileNjStaffRole::TYPE" that can manage nj state efile erorr?
private | ||
|
||
def auto_transition_to_state(efile_error, submission) | ||
return :cancelled if efile_error.auto_cancel |
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.
is there a way we can just transition all the efile submissions to cancelled if the efile_error is auto_cancel up on line 52 instead of looping through all of them each time?
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.
I guess it doesn't matter that much though since we probably won't have that many submissions to reprocess each time, so more of just an idea [DUST]
Link to pivotal/JIRA issue
Is PM acceptance required? (delete one)
Reminder: merge main into this branch and get green tests before merging to main
What was done?
handling: means an admin set
auto_wait
,expose
,auto_cancel
flags on an efile error. When the next time this error is seen (on a different submission), it will apply that same handling for the new submission (efile_submission_transition_error
that points to the sharedEfileError
-- seeEfile::SubmissionErrorParser
for more information)auto_wait: true
efiling error triggers a notification for the user to correct their submission (AfterTransitionTasksForRejectedReturnJob
)EfileErrorsController
#reprocess
method)service_type
set tostate_file_#{state_code}
so added thoseefile_submissions
factoryfor_state
attribute to utilizestate_file_az_intake
as the data_source instead ofstate_file_ny_intake
to utilize what's liveHow to test?
AfterTransitionTasksForRejectedReturnJob
, create an efile error for a state, create a submission and transition the submission to "failed" state and watch it get notified?Screenshots (for visual changes)