Skip to content

Commit

Permalink
[IHRACP-4621] Adding an 'action' key in the offers schema. (#94)
Browse files Browse the repository at this point in the history
* Adding an 'action' key in the offers schema.

* Update language parameter in conf.py as per below:
sphinx-doc/sphinx#10474

Co-authored-by: priyanshu mayank <[email protected]>
Co-authored-by: Mohit Thakkar <[email protected]>
  • Loading branch information
3 people authored Sep 20, 2022
1 parent feb0e0b commit 7e1ea3f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
Changelog
=========

Version 2.7.0
==============

- Adding an ``action`` key in the offers schema, this specifies the
action [``upsert`` or ``takedown``] at offers level.

Version 2.6.0
==============

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down
1 change: 1 addition & 0 deletions pipeline/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ def validate_schema(schema, message, logger=None):
"""

offer = SchemaAllRequired({
'action': str,
'commercialModelType': CommercialModelType,
'licensee': str,
Optional('price'): Any(None, str),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='pipeline',
version='2.6.0',
version='2.7.0',
packages=find_packages(exclude=['tests']),
install_requires=[
'Henson>=0.5.0',
Expand Down
4 changes: 4 additions & 0 deletions tests/data/schema/valid-nulled-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"numVolumes": 1,
"offers": [
{
"action": "upsert",
"commercialModelType": "SubscriptionModel",
"licensee": "iheart",
"territoryCode": "WW",
Expand All @@ -39,6 +40,7 @@
"validThrough": "2100-01-01T00:00:00.000000+00:00"
},
{
"action": "upsert",
"commercialModelType": "AdvertisementSupportedModel",
"licensee": "iheart",
"territoryCode": "WW",
Expand Down Expand Up @@ -99,6 +101,7 @@
"number": 1,
"offers": [
{
"action": "upsert",
"commercialModelType": "SubscriptionModel",
"licensee": "iheart",
"territoryCode": "AU",
Expand All @@ -110,6 +113,7 @@
"validThrough": "2100-01-01T00:00:00.000000+00:00"
},
{
"action": "upsert",
"commercialModelType": "AdvertisementSupportedModel",
"licensee": "iheart",
"territoryCode": "AU",
Expand Down
1 change: 1 addition & 0 deletions tests/data/schema/valid-offer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"action": "upsert",
"commercialModelType": "SubscriptionModel",
"licensee": "iheart",
"territoryCode": "US",
Expand Down
2 changes: 2 additions & 0 deletions tests/data/schema/valid.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"numVolumes": 1,
"offers": [
{
"action": "upsert",
"commercialModelType": "AdvertisementSupportedModel",
"licensee": "iHeartMedia",
"territoryCode": "US",
Expand Down Expand Up @@ -101,6 +102,7 @@
},
"offers": [
{
"action": "upsert",
"commercialModelType": "SubscriptionModel",
"licensee": "iHeartMedia",
"territoryCode": "US",
Expand Down

0 comments on commit 7e1ea3f

Please sign in to comment.