mitodl / mitxpro

BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

fix: sync start dates for programs & courses between Program/Course pages & APIs #2999

Closed arslanashraf7 closed 4 months ago

arslanashraf7 commented 4 months ago

What are the relevant tickets?

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

Description (What does it do?)

How can this be tested?

NOTE:

  1. With this change the start dates should be equal to the start date of the earliest reactive course run from the first course in the program
  2. The start date for a program could be null if there are no active course runs for the first course in the program
arslanashraf7 commented 4 months ago

The change looks good but I have noticed a few more irregularities:

One that we should fix in this PR:

  • We need to fix the enrollment_start in the API. It has the same logic as the start_date.

I agree, I've updated the PR. I have also updated the end date conditions to check for live runs. Tests updated as well.

Couple that we need to think about / do later:

  • Current logic for start_date and Program enrollment from CMS Page depends heavily on Course.position_in_program == 1. If there is no course with position = 1, we do not display start dates from other courses with positions 2,3, etc. Also, if there is no course with position 1, the learners cannot enroll in the program.
  • If a course has a start datetime of 31st May 2024 23:59:00 then the start date on the checkout page is 1st June 2024. Like this course run starts at April 3, 2023 23:59:00 https://rc.xpro.mit.edu/admin/courses/courserun/142/change/ and the CMS page shows April 3, 2023. But if you check it out https://rc.xpro.mit.edu/courses/FDV/. You will see April 4, 2023 on the checkout page https://rc.xpro.mit.edu/checkout/?product=124

Could you create a ticket for this? I think we should look at this in details with a separate ticket.