feat: unenroll and expire entitlements on returns#527
Merged
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8645437 to
7ee6fec
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “order returned” flow that triggers LMS unenrollment and entitlement expiration by enqueueing a dedicated revoke task when Commercetools sends a return event.
Changes:
- Wire the Commercetools “order returned” signal to a new
revoke_line_itemsreceiver viaCC_SIGNALS. - Implement
revoke_line_items_taskto resolve returned line items and call Order Fulfillment’s revoke-line endpoint (including entitlement UUID when present). - Expand tests and update related docstrings/serializers to support the new revoke payload.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| commerce_coordinator/settings/base.py | Registers revoke_line_items receiver for the returned-order signal. |
| commerce_coordinator/apps/order_fulfillment/serializers.py | Adds optional entitlement_uuid field to the revoke-line request serializer. |
| commerce_coordinator/apps/commercetools/views.py | Updates returned-order view docstrings to reflect revoke behavior. |
| commerce_coordinator/apps/commercetools/tasks.py | Adds revoke_line_items_task implementation to unenroll/expire on returns. |
| commerce_coordinator/apps/commercetools/signals.py | Adds revoke_line_items signal receiver that enqueues the new task. |
| commerce_coordinator/apps/commercetools/tests/test_tasks.py | Adds unit tests for revoke_line_items_task. |
| commerce_coordinator/apps/commercetools/tests/test_signals.py | Adds unit tests for the new revoke_line_items signal receiver. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7ee6fec to
6e49ac7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cd1fae5 to
73f6a42
Compare
colinbrash
approved these changes
Mar 31, 2026
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.
Internal ticket: https://redventures.atlassian.net/browse/RV2U-460
Merge checklist:
Check off if complete or not applicable:
Post-merge: