New LearningResourcePrice model #1736
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
PR 1 of 5 to address https://github.com/mitodl/hq/issues/5134 and https://github.com/mitodl/hq/issues/4685
Description (What does it do?)
LearningResourcePricemodel with two fields (amount,currency)resource_prices)resource_pricesfieldHow can this be tested?
http://open.odl.local:8062/search?platform=mitxonline&platform=xpro, you will see a mix of courses that should all either be paid with certificate (xpro) or free with a paid certificate option (mitxonline). If you click on a course card you will see the same price in the drawer.docker compose build web celery(new python package) and restart containers. Make sure the new migrations complete successfully.http://open.odl.local:8062/search?platform=mitxonline&platform=xproagain. Everything should still look the same.resource_pricesattribute for the resource and each of it's runs, withamountandcurrencyattributes../manage.py update_index --courses --programs, then wait a minute or 2.http://open.odl.local:8062/search?platform=mitxonline&platform=xproagain. It should still look the same, and if you inspect search API results, theresource_pricesfield should be there too../manage.py recreate_index --all, it should complete without errors.SEE_*andEDX_API_*):vs
pricesfield should be restored with values:Additional Context
resource_pricesfield instead ofpricesLearningResource.pricesandLearningResourceRun.pricesfields to be the same asresource_prices, and update schema. (Note: this will cause index updates to fail until a reindex completes)pricesfield againresource_pricesfrom models and schemas.