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

Implement bid adjustments by media type #1226

Merged
merged 13 commits into from
Apr 22, 2021
Merged

Conversation

SerhiiNahornyi
Copy link
Collaborator

No description provided.

resolveImpMediaType(bid.getImpid(), requestImps, bidderBid.getType());

final BigDecimal priceAdjustmentFactor =
bidAdjustmentForBidder(bidRequest, bidderResponse.getBidder(), mediaType);
Copy link
Contributor

Choose a reason for hiding this comment

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

Pls set bidder as first argument since you call it.


import com.fasterxml.jackson.annotation.JsonProperty;

public enum AdjustmentsMediaType {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it better to name it as BidAdjustmentMediaType ?

case video:
return resolveVideoMediaType(bidImpId, imps);
default:
throw new IllegalArgumentException("BidType not present for bidderBid");
Copy link
Contributor

Choose a reason for hiding this comment

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

This error should be PreBidException type (since indirectly it is verfied by RequestValidator) and should not fail entire auction.
Ideally, it can be covered by unit-test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually it's just for check style(switch default), because this exception is not possible at any case.
But replaced IllegalArgumentException with PreBidException

}
}

private static AdjustmentsMediaType resolveVideoMediaType(String bidImpId, List<Imp> imps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Pls rename to resolveBidAdjustmentVideoMediaType()

: null;
}

private static BigDecimal resolveAdjustmentFactor(ExtRequestBidadjustmentfactors extBidadjustmentfactors,
Copy link
Contributor

Choose a reason for hiding this comment

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

Pls rename to resolveBidAdjustmentFactor()

@@ -1084,6 +1088,61 @@ private BidderResponse applyBidPriceChanges(BidderResponse bidderResponse, BidRe
return bidderResponse.with(BidderSeatBid.of(updatedBidderBids, seatBid.getHttpCalls(), errors));
}

private static AdjustmentsMediaType resolveImpMediaType(String bidImpId, List<Imp> imps, BidType bidType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Pls rename to resolveBidAdjustmentMediaType().

Comment on lines 1068 to 1071
final AdjustmentsMediaType mediaType =
resolveImpMediaType(bid.getImpid(), requestImps, bidderBid.getType());

final BigDecimal priceAdjustmentFactor =
Copy link
Contributor

Choose a reason for hiding this comment

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

Price adjustment can be refactored to separate method.
Too much details for applyBidPriceChanges().

@@ -43,7 +43,14 @@
"ext": {
"prebid": {
"bidadjustmentfactors": {
"33across": 0.7
"mediatypes": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Pls change rubicon bidder test instead. Other bidder tests should be simple as possible.
Probably we'll need to divide rubicon-tests into some functional way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved this logic to multifid rubicon test, because current rubicon-appnexus test, has already to many test conditions

@rpanchyk rpanchyk merged commit f2ed301 into master Apr 22, 2021
@rpanchyk rpanchyk deleted the adjustments/implekenting branch April 22, 2021 11:24
@rpanchyk rpanchyk mentioned this pull request Apr 22, 2021
nickluck9 pushed a commit that referenced this pull request Aug 9, 2021
* Implement bid adjustments by media type

* Add additional validation

* Code style fixes

* Logic update

* Fixes after review

* Fixes after review 2.0

* Fixes after review 2.0.1

* Fixes after review 2.0-STABLE
nickluck9 pushed a commit that referenced this pull request Aug 10, 2021
* Implement bid adjustments by media type

* Add additional validation

* Code style fixes

* Logic update

* Fixes after review

* Fixes after review 2.0

* Fixes after review 2.0.1

* Fixes after review 2.0-STABLE
nickluck9 pushed a commit that referenced this pull request Aug 10, 2021
* Implement bid adjustments by media type

* Add additional validation

* Code style fixes

* Logic update

* Fixes after review

* Fixes after review 2.0

* Fixes after review 2.0.1

* Fixes after review 2.0-STABLE
SerhiiNahornyi pushed a commit that referenced this pull request Nov 30, 2023
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.

2 participants