-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support price granularity per mediaType #2348
Support price granularity per mediaType #2348
Conversation
…2347-support-price-granularity-per-mediatype
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@idettman Need docs PR open to merge this |
set mediaTypePriceGranularity(val) { | ||
this._mediaTypePriceGranularity = Object.keys(val).reduce((aggregate, item) => { | ||
if (validatePriceGranularity(val[item])) { | ||
if (typeof val === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this code was copied from the function above around line ~90. Can we combine it/make more generic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially had the logic for both extracted into a generic function, but the added complexity specific for mediaTypesGranularity resulted in more code than inlining with the additional conditionals
@idettman |
…2347-support-price-granularity-per-mediatype
…2347-support-price-granularity-per-mediatype
Docs PR at prebid/prebid.github.io#764 -- since it touched the Pub API, combined it with some refactoring. |
* Add config support for mediaTypePriceGranularity * Update to set default granularity to use config default * Formatting change, comment updated * Formatting change * Added test for mediaTypePriceGranularity enabled * Added test for mediaTypePriceGranularity video type * Changed double quotes to single in config_spec * Linting fixes for indentation and spacing
Type of change
Description of change
Add support for setting price granularity per mediaType.
Use case:
Proposal is to allow the definition of the priceGranularity at a mediaType level:
Other information
https://jira.rubiconproject.com/projects/HB/issues/HB-2347