Skip to content
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

feat: write reversal on LC enrollment revoked event #282

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

pwnage101
Copy link
Contributor

@pwnage101 pwnage101 commented Aug 6, 2024

Handle the following event bus event: org.openedx.enterprise.learner_credit_course_enrollment.revoked.v1
under the following openedx-events signal: LEARNER_CREDIT_COURSE_ENROLLMENT_REVOKED

This will perform the same duties as the write_reversals_from_enterprise_unenrollments management command, except it operates on only one unenrollment at a time, and no longer calls the "recent unenrollments" API located at:

{LMS_BASE_URL}/enterprise/api/v1/operator/enterprise-subsidy-fulfillment/unenrolled/

ENT-9213

@iloveagent57
Copy link
Contributor

Seems reasonable to me.

@pwnage101 pwnage101 force-pushed the pwnage101/ENT-9213 branch 3 times, most recently from 05d820f to 3375576 Compare August 7, 2024 23:19
@pwnage101 pwnage101 marked this pull request as ready for review August 7, 2024 23:19
@pwnage101
Copy link
Contributor Author

I don't know why the PII checker is barfing, but maybe related to weird openedx-events requirement (hard-coded URL with hash). Trust me tests pass.

Comment on lines 21 to 22

git+https://github.com/pwnage101/openedx-events.git@f00926ae93e84a114779a0e9c98c152e8927706d#egg=openedx_events
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] do these need to be removed from all the requiremetns files before its merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, this PR is blocked on merging my openedx-events PR, after which point I'll update this PR to have normal requirements.

@pwnage101 pwnage101 force-pushed the pwnage101/ENT-9213 branch 2 times, most recently from f1f8f88 to b084558 Compare August 8, 2024 16:59
@pwnage101 pwnage101 force-pushed the pwnage101/ENT-9213 branch 2 times, most recently from ef53136 to 64f7ec7 Compare September 6, 2024 17:07
pwnage101 and others added 2 commits January 6, 2025 16:10
Handle the following event bus event: org.openedx.enterprise.learner_credit_course_enrollment.revoked.v1
under the following openedx-signal: LEARNER_CREDIT_COURSE_ENROLLMENT_REVOKED

This will perform the same duties as the
`write_reversals_from_enterprise_unenrollments` management command,
except it operates on only one unenrollment at a time, and no longer
calls the "recent unenrollments" API located at:

{LMS_BASE_URL}/enterprise/api/v1/operator/enterprise-subsidy-fulfillment/unenrolled/

ENT-9213
…LATION

This setting is True in all internal environments now.
@pwnage101
Copy link
Contributor Author

I added a 3rd commit to do a couple things:

  1. Extract out the duplicate logic which checks if an unenrollment is refundable to utils.py. Now, both the management command and the signal handler share that same function.
  2. Gate the handle_lc_enrollment_revoked() signal handler behind a feature flag so that we can safely test in stage without enabling in prod.

@pwnage101 pwnage101 merged commit 99a9d55 into main Jan 7, 2025
7 checks passed
@pwnage101 pwnage101 deleted the pwnage101/ENT-9213 branch January 7, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants