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

fix: update allocate endpoint request payload #303

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions swagger/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ paths:
# Enterprise Access IDA
# These are served from the enterprise-access IDA, but we surface them with the rest of the enterprise endpoints
"/enterprise/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/cancel/":
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/8975f08/api.yaml#/endpoints/v1/learnerContentAssignmentCancelRequest"
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/7b79f45/api.yaml#/endpoints/v1/learnerContentAssignmentCancelRequest"
Copy link
Member

Choose a reason for hiding this comment

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

Any reason of updating hash in the cancel API's?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just to keep all enterprise-access endpoints point the same version to avoid any unexpected test failures. This happened with me once so being cautious. :)

"/enterprise/v1/assignment-configurations/{assignment_configuration_uuid}/admin/assignments/remind/":
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/8975f08/api.yaml#/endpoints/v1/learnerContentAssignmentRemindRequest"
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/7b79f45/api.yaml#/endpoints/v1/learnerContentAssignmentRemindRequest"
"/enterprise/v1/policy-allocation/{policy_uuid}/allocate/":
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/8975f08/api.yaml#/endpoints/v1/subsidyAccessPolicyAllocation"
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/7b79f45/api.yaml#/endpoints/v1/subsidyAccessPolicyAllocation"
"/enterprise/v1/subsidy-access-policies/":
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/1701d4a/api.yaml#/endpoints/v1/subsidyAccessPolicies"
$ref: "https://raw.githubusercontent.com/openedx/enterprise-access/7b79f45/api.yaml#/endpoints/v1/subsidyAccessPolicies"
# Enterprise Catalog IDA
# These are served from the enterprise catalog IDA, but we surface them with the rest of the enterprise endpoints
"/enterprise/v2/enterprise-catalogs":
Expand Down
18 changes: 9 additions & 9 deletions tests/test_enterprise_access.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@

- test:
- name: 'Policy Allocation endpoint returns HTTP 200'
- url: '/enterprise/v1/policy-allocation/9101d3de36156cba/allocate?content_key=edx+DemoX&content_price_cents=55&learner_emails=["[email protected]"]'
- url: '/enterprise/v1/policy-allocation/9101d3de36156cba/allocate'
- method: 'POST'
- headers: { 'Authorization': 'aeiou', 'Content-Type': 'application/json' }
- body: >
[
{
"learner_emails": ["[email protected]"],
"content_key": "edx+101",
"content_price_cents": 4500
}
]
- expected_status: [200]

- test:
- name: 'Policy Allocation endpoint rejected without Authorization'
- url: '/enterprise/v1/policy-allocation/9101d3de36156cba/allocate?content_key=edx+DemoX&content_price_cents=55&learner_emails=["[email protected]"]'
- method: 'POST'
- expected_status: [400]

- test:
- name: 'Policy Allocation endpoint returns HTTP 400 when required query param is missing'
- url: '/enterprise/v1/policy-allocation/9101d3de36156cba/allocate'
- method: 'POST'
- headers: { 'Authorization': 'aeiou', 'Content-Type': 'application/json' }
- expected_status: [400]


- test:
- name: 'Assignment configuration cancel endpoint returns HTTP 200'
- url: '/enterprise/v1/assignment-configurations/9101d3de36156cba/admin/assignments/cancel/'
Expand Down