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

sort direct_priority rates on top when prices are in parity #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hoantony
Copy link
Contributor

@hoantony hoantony commented Jun 20, 2018

Purpose

https://wegomushi.atlassian.net/browse/BE-1332

When the provider status is set to direct priority, when rates are in parity, irrespective of the cpc's of various providers the direct priority provider has to be displayed on top.

Status

  • deployed and tested on staging

var basePriceA = totalAmountA - totalTaxAmountA,
basePriceB = totalAmountB - totalTaxAmountB;

if (basePriceA !== basePriceB) return basePriceA - basePriceB;
Copy link
Contributor

Choose a reason for hiding this comment

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

hey @hoantony, from JIRA ticket, looks like we want to have direct partner on top disregard of the price. Can you confirm if that is the logic? If so, comparing by provider type will be higher priority than by price.

Copy link
Contributor Author

@hoantony hoantony Jun 20, 2018

Choose a reason for hiding this comment

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

@viettienn the logic here is correct. We only compare the Provider_types (which DRIECT_PRIORITY has higher priority) only when the prices are in parity. So the sorting conditions will be in order: amount -> provider_type -> ecpc.

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.

3 participants