Skip to content

Add failed filter to /codes - #3827

Merged
dsubak merged 2 commits into
mainfrom
dansubak/202608_add_failed_filter
Aug 11, 2026
Merged

Add failed filter to /codes#3827
dsubak merged 2 commits into
mainfrom
dansubak/202608_add_failed_filter

Conversation

@dsubak

@dsubak dsubak commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

https://github.com/mitodl/hq/issues/12722

Description (What does it do?)

Adds a new status filter value. This value allows callers to filter down to records which are unredeemed and have received a permanent failure status event from mailgun.

How can this be tested?

  • Create a b2b contract w/ one or more codes and set yourself as a manager of the corresponding organization.
  • Preassign a least one code. Find the DiscountContractAttachmentRedemption for this code.
  • Run ./manage.py b2b_send_mailgun_webhook <record_id> failed --host='http://<local_mitxonline_host>:<port>'
  • Visit /api/schema/swagger-ui/#/b2b/b2b_manager_organizations_contracts_codes_list and specify your contract and status=failed as args. You should only get the record you just recorded a webhook for.
Screenshot 2026-08-07 at 11 16 23 AM

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

OpenAPI Changes

Show/hide changes
## Changes for v0.yaml:
1 changes: 0 error, 0 warning, 1 info
info	[request-parameter-enum-value-added] at head/openapi/specs/v0.yaml
	in API GET /api/v0/b2b/manager/organizations/{parent_lookup_organization}/contracts/{id}/codes/
		added the new enum value `failed` to the `query` request parameter `status`



## Changes for v1.yaml:
1 changes: 0 error, 0 warning, 1 info
info	[request-parameter-enum-value-added] at head/openapi/specs/v1.yaml
	in API GET /api/v0/b2b/manager/organizations/{parent_lookup_organization}/contracts/{id}/codes/
		added the new enum value `failed` to the `query` request parameter `status`



## Changes for v2.yaml:
1 changes: 0 error, 0 warning, 1 info
info	[request-parameter-enum-value-added] at head/openapi/specs/v2.yaml
	in API GET /api/v0/b2b/manager/organizations/{parent_lookup_organization}/contracts/{id}/codes/
		added the new enum value `failed` to the `query` request parameter `status`



Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@dsubak
dsubak force-pushed the dansubak/202608_add_failed_filter branch from a1d9d0c to 0023b43 Compare August 7, 2026 12:29
@dsubak
dsubak marked this pull request as ready for review August 7, 2026 15:16
@dsubak dsubak changed the title Dansubak/202608 add failed filter Add failed filter to /codes Aug 7, 2026

@daniellefrappier18 daniellefrappier18 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@dsubak
dsubak merged commit 2c860c1 into main Aug 11, 2026
13 checks passed
@dsubak
dsubak deleted the dansubak/202608_add_failed_filter branch August 11, 2026 14:43
@odlbot odlbot mentioned this pull request Aug 11, 2026
10 tasks
asadali145 pushed a commit that referenced this pull request Aug 13, 2026
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.

2 participants