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: Added mobile api for course enrollment and other details. #35100

Merged
merged 6 commits into from
Jul 17, 2024

Conversation

jawad-khan
Copy link
Contributor

@jawad-khan jawad-khan commented Jul 9, 2024

Description

Added mobile api for course enrollment and other details. This api provide a separate endpoint for all course enrollment details.

Useful information to include:

  • This will effect all mobile app users.

Supporting information

Jira Ticket: https://2u-internal.atlassian.net/browse/LEARNER-10031

Sample response data that this api should return

{
  "id": "course-v1:IB12T21",
  "course_updates": {course-updates-url},
  "course_handouts":{{course-handouts-url}},
  "discussion_url": {discussion-url},
  "course_access_details": {
    "has_unmet_prerequisites": false,
    "is_too_early": false,
    "is_staff": true,
    "audit_access_expires": null,
    "courseware_access": {
      "has_access": true,
      "error_code": null,
      "developer_message": null,
      "user_message": null,
      "additional_context_user_message": null,
      "user_fragment": null
    }
  },
  "certificate": {
    
  },
  "enrollment_details": {
    "mode": "",
    "is_active": false
  },
  "course_info_overview": {
      "name": "Introduction to Data Science",
  "number": "Abc",
  "org": "IBM",
  "start": "2021-07-01T16:00:00Z",
  "start_display": "July 1, 2021",
  "start_type": "timestamp",
  "end": "2023-10-16T16:00:00Z",
  "is_self_paced": true,
  "media": {
    "image": {
      "raw": "/asset-v1+_image.png",
      "small": "/asset-v1.jpg",
      "large": "/a.jpg"
    }
  },
  "course_sharing_utm_parameters": {
    "facebook": "utm_medium=social&utm_campaign=social-sharing-db&utm_source=facebook",
    "twitter": "utm_medium=social&utm_campaign=social-sharing-db&utm_source=twitter"
  },
  "course_about": {course-about-url},
  "course_modes": [
    {
      "slug": "audit",
      "sku": "5479",
      "android_sku": null,
      "ios_sku": null,
      "min_price": 0
    }
  ]
  }
}

Testing instructions

Call api /api/mobile/{api_version}/course_info/{course_id}}/enrollment_details
and compare data with expected data given above.

Deadline

"ASAP".

@miankhalid
Copy link

@GlugovGrGlib can you or someone from your team give this PR a look?

@@ -1,3 +0,0 @@
# We want to ignore files in this directory which we do in the
Copy link
Member

Choose a reason for hiding this comment

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

Is this comment no longer accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed from PR.

@ddt.data(
({'is_downloadable': True, 'download_url': 'https://test_certificate_url'},
{'url': 'https://test_certificate_url'}),
({'is_downloadable': False}, {}),
Copy link
Member

Choose a reason for hiding this comment

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

It looks like you deleted a test here that perform the negative test (does your code do the right thing if is_downloadable is False) and I don't see that you replaced it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added separate test case for this.

@jawad-khan jawad-khan merged commit 3589d96 into master Jul 17, 2024
49 checks passed
@jawad-khan jawad-khan deleted the jawad/LEARNER-10031 branch July 17, 2024 08:19
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

mudassir-hafeez pushed a commit to mudassir-hafeez/edx-platform that referenced this pull request Jul 24, 2024
…edx#35100)

* feat: Added mobile api for course enrollment and other details.
mudassir-hafeez pushed a commit to mudassir-hafeez/edx-platform that referenced this pull request Jul 24, 2024
…edx#35100)

* feat: Added mobile api for course enrollment and other details.
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.

4 participants