-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor: introduce enrollment module #2338
Conversation
this helps separate the business logic from the decision of what response to return
make minimally needed changes to keep unit tests passing. they will be refactored to separate the view logic from the business logic in a separate commit.
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
view tests collapse down into one test
view tests collapse down into one test
it would be a success scenario if it were implemented
they were essentially moved to `test_enrollment`
94f383a
to
13de9bc
Compare
it was easier for me to leave this until the end of all the refactoring
13de9bc
to
7abf4e5
Compare
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! 👍 I tested locally (also simulated a 500-level HTTP error) and enrollment worked as expected.
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.
This is such a clean refactor, well done 💯 🥇
I only have 2 non-blocking comments:
- It would be helpful to have some docstrings for the new
enroll
helper, since that is used by callers external to theenrollment
module. - It seems like the
token
view function could also be refactored in a similar way, and re-use the sameStatus
enum concept.
One or both of these can definitely be follow-ups.
e4b4d7a
Good idea. I added that in e4b4d7a - open to any suggestions or tweaks
Yep, definitely. I think it makes sense as a follow-up PR. It is definitely needed for completeness in handling system errors and server errors, |
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.
👍
Part of #2327
Refactors out logic from
benefits.enrollment.views
for calling the transit processor API out into a separate module. This will make it easier to reuse the logic for the in-person enrollment view.Uses an
Enum
as the result of the enrollment attempt.Manual testing
There shouldn't be any regressions to enrollment in the Benefits app.