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

Improve Digital adapter: Add deal id and rewardred inventory logic #2439

Merged
merged 5 commits into from
Nov 17, 2022

Conversation

jbartek25
Copy link
Contributor

  • Handle Rewarded inventory flag
  • Add dealid

// BidExt This struct usage for parse line_item_id and buying_type from bid.ext
type BidExt struct {
Improvedigital struct {
LineItemId int `json:"line_item_id"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: could you re-name this variable to be LineItemID

adapters/improvedigital/improvedigital.go Outdated Show resolved Hide resolved
@@ -36,6 +54,15 @@ func (a *ImprovedigitalAdapter) MakeRequests(request *openrtb2.BidRequest, reqIn
}

func (a *ImprovedigitalAdapter) makeRequest(request openrtb2.BidRequest, imp openrtb2.Imp) (*adapters.RequestData, error) {
// Handle Rewarded Inventory
extImp, err := getImpExtWithRewardedInventory(imp)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: Could you re-name this to be impExt

type ImprovedigitalAdapter struct {
endpoint string
}

// BidExt This struct usage for parse line_item_id and buying_type from bid.ext
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: Please rephrase this as BidExt represents Improved Digital bid extension with line item ID and buying type values

mansinahar
mansinahar previously approved these changes Nov 3, 2022
…pr-fix

Deal id + rewarded inventory flag
@jbartek25
Copy link
Contributor Author

Sorry for the mess. I thought this PR was already merged. Reopening.

@jbartek25 jbartek25 reopened this Nov 8, 2022
Copy link
Contributor

@mansinahar mansinahar left a comment

Choose a reason for hiding this comment

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

Other than the minor comment below, LGTM

return nil, nil
}

if string(rewardedInventory) == stateRewardedInventoryEnable {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor comment: You can simplify this code a little by combining the two if statements as

if rewardedInventory, foundRewardedInventory := prebidMap[isRewardedInventory]; foundRewardedInventory && string(rewardedInventory) == stateRewardedInventoryEnable {
	ext[isRewardedInventory] = json.RawMessage(`true`)
	impExt, err := json.Marshal(ext)
	.
	.
}
return nil, nil

@bsardo bsardo merged commit 563f6c6 into prebid:master Nov 17, 2022
shunj-nb pushed a commit to ParticleMedia/prebid-server that referenced this pull request Jan 31, 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.

6 participants