LG-10126: For notification phone configurations; handle expired enrollments outside of jobs#8875
Merged
tomas-nava merged 4 commits intomainfrom Jul 27, 2023
Merged
Conversation
added 2 commits
July 26, 2023 15:17
changelog: Internal, In-person proofing, Delete notification phone configuration when enrollment is marked expired
svalexander
reviewed
Jul 27, 2023
|
|
||
| has_one :notification_phone_configuration, dependent: :destroy, inverse_of: :in_person_enrollment | ||
|
|
||
| STATUS_ESTABLISHING = 'establishing' |
Contributor
There was a problem hiding this comment.
good change - i like that this now looks more like an enum
svalexander
reviewed
Jul 27, 2023
| ) | ||
|
|
||
| enrollment.profile.activate if raw_enrollment_status == 'passed' | ||
| if raw_enrollment_status == InPersonEnrollment::STATUS_PASSED |
Contributor
There was a problem hiding this comment.
subtle change but i do think it's more immediately readable
sheldon-b
approved these changes
Jul 27, 2023
Contributor
sheldon-b
left a comment
There was a problem hiding this comment.
Cool! Nice refactor. One question for my own benefit
| def enrollment_will_be_cancelled? | ||
| status_change_to_be_saved&.last == 'cancelled' | ||
| def enrollment_will_be_cancelled_or_expired? | ||
| [STATUS_CANCELLED, STATUS_EXPIRED].include? status_change_to_be_saved&.last |
Contributor
There was a problem hiding this comment.
What is status_change_to_be_saved? Is that some ActiveRecord thing showing staged changes yet to be committed to the db? I didn't see anything on a quick google search
Contributor
Author
There was a problem hiding this comment.
yeah, it's rails magic. You can use <name>_change_to_be_saved to get the value for any variable that's being updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎫 Ticket
Related to LG-10126
🛠 Summary of changes
Has the
InPersonEnrollmentmodel deleteNotificationPhoneConfigurationassociated with enrollments when they expire, rather than relying on theGetUspsProofingResultsJobor theSendProofingNotificationJobto delete them. (see d67c903)Also starts using constants to refer to the in person enrollment states, for clarity when reading and writing code. (see c0e725d)