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: v2 customer content-metadata endpoint #991

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

iloveagent57
Copy link
Contributor

@iloveagent57 iloveagent57 commented Oct 29, 2024

Testing

You need a restricted run setup first, see for instructions: #985

Content Metadata Retrieve

GET http://localhost:18160/api/v2/enterprise-customer/378d5bf0-f67d-4bf7-8b2a-cbbc53d0f772/content-metadata/course-v1%3AedX%2BDemoX%2Brestricted_run/

response:

{
    "key": "course-v1:edX+DemoX+restricted_run",
    "uuid": "4772f672-583d-401a-a948-34b1a66e9cde",
    "title": "edX Demonstration Course",
    "external_key": null,
    "fixed_price_usd": null,
    "image": null,
    "short_description": "",
    "marketing_url": "course/test-comrsch-ajedrgwvydvk-course-v1orgsuytibiasoigfake?utm_medium=enterprise&utm_source=pied-piper",
    "seats": [
        {
            "type": "verified",
            "price": "73.10",
            "currency": "AED",
            "upgrade_deadline": "2028-10-21T20:27:24Z",
            "upgrade_deadline_override": "2028-10-21T20:27:24Z",
            "credit_provider": null,
            "credit_hours": null,
            "sku": "RxucNNGN",
            "bulk_sku": "DgJCzVNo"
        }
    ],
    "start": "2015-02-02T02:46:43Z",
    "end": "2027-07-09T17:13:41Z",
    "go_live_date": null,
    "enrollment_start": "2016-07-12T06:48:26Z",
    "enrollment_end": "2027-09-10T06:33:49Z",
    "weeks_to_complete": 1,
    "pacing_type": "instructor_paced",
    "type": "verified",
    "restriction_type": "custom-b2b-enterprise",
    "run_type": "f1340c0d-67af-40c1-9179-f209f5bf9515",
    "status": "unpublished",
    "is_enrollable": true,
    "is_marketable": false,
    "availability": "Current",
    "variant_id": null,
    "course": "edX+DemoX"
    # there's more, truncated for brevity
}

Contains Content Items

GET http://localhost:18160/api/v2/enterprise-customer/378d5bf0-f67d-4bf7-8b2a-cbbc53d0f772/contains_content_items/?course_run_ids=course-v1%3AedX%2BDemoX%2Brestricted_run&get_catalog_list=true

response:

{
    "contains_content_items": true,
    "catalog_list": [
        "7467c9d2-433c-4f7e-ba2e-c5c7798527b2"
    ]
}

Filter content items

POST http://localhost:18160/api/v2/enterprise-customer/378d5bf0-f67d-4bf7-8b2a-cbbc53d0f772/filter_content_items/

{
    "content_keys": ["course-v1:edX+DemoX+restricted_run", "course-v1:some+other+run"]    
}

response

{
    "filtered_content_keys": [
        "course-v1:edX+DemoX+restricted_run"
    ]
}

Post-review

  • Squash commits into discrete sets of changes
  • Ensure that once the changes have been deployed to stage, prod is manually deployed

@iloveagent57 iloveagent57 force-pushed the aed/customer-metadata-v2-endpoint branch 6 times, most recently from cbf68ea to b583375 Compare October 31, 2024 14:36
@@ -357,152 +302,6 @@ def test_contains_catalog_list_with_catalog_list_param(self):
catalog_list = response.json()['catalog_list']
assert set(catalog_list) == {str(second_catalog.uuid)}

@pytest.mark.skip(reason="We need a version of this test for the v2 API.")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These tests were all written with our now-abandoned restricted run architecture in mind.

@iloveagent57 iloveagent57 force-pushed the aed/customer-metadata-v2-endpoint branch from b583375 to d12b947 Compare October 31, 2024 14:50
Copy link
Member

@adamstankiewicz adamstankiewicz left a comment

Choose a reason for hiding this comment

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

Overall, looks great! I just had a couple nit comments to clarify/consider.

@iloveagent57 iloveagent57 force-pushed the aed/customer-metadata-v2-endpoint branch from d12b947 to c52717c Compare November 1, 2024 14:59
@iloveagent57 iloveagent57 merged commit 84c51c9 into master Nov 1, 2024
4 checks passed
@iloveagent57 iloveagent57 deleted the aed/customer-metadata-v2-endpoint branch November 1, 2024 15:39
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