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

New has_not_taxon rule #58

Merged
merged 9 commits into from
Oct 12, 2021
Merged

New has_not_taxon rule #58

merged 9 commits into from
Oct 12, 2021

Conversation

igormukhingmailcom
Copy link
Member

@igormukhingmailcom igormukhingmailcom commented Oct 12, 2021

image

Promotion applied to Santa caps (except Santa caps with pompons):
image

Promotion applied to t-shirts (except men):
image

TLDR:
Before 86d6d14, the query was like this and gave us the incorrect result:

use setono_catalog_promotion_dev;
SELECT DISTINCT o.id, o.code
FROM sylius_product_variant AS o 
	INNER JOIN sylius_channel_pricing AS channelPricings40 ON channelPricings40.product_variant_id=o.id
    INNER JOIN sylius_product_taxon AS product_taxons42 ON product_taxons42.product_id=o.product_id
    INNER JOIN sylius_taxon AS taxon43 ON taxon43.id=product_taxons42.taxon_id
WHERE 
	channelPricings40.manually_discounted = false 
	AND taxon43.code IN ('t_shirts') 
    AND taxon43.code NOT IN ('mens_t_shirts')
;

So, right query was implemented at 86d6d14:

use setono_catalog_promotion_dev;

-- t_shirts.id = 41
-- mens_t_shirts.id = 42

SELECT distinct o.id
FROM sylius_product_variant AS o 
	LEFT JOIN sylius_channel_pricing AS channelPricings40 ON channelPricings40.product_variant_id=o.id
WHERE
	channelPricings40.manually_discounted = false
    AND o.id IN (SELECT pv.id FROM sylius_product_variant AS pv LEFT JOIN sylius_product_taxon AS pt ON pt.product_id=pv.product_id WHERE  pt.taxon_id IN (41))
    AND o.id NOT IN (SELECT pv.id FROM sylius_product_variant AS pv LEFT JOIN sylius_product_taxon AS pt ON pt.product_id=pv.product_id WHERE pt.taxon_id IN (42))
;

@codecov
Copy link

codecov bot commented Oct 12, 2021

Codecov Report

Merging #58 (e771659) into master (81c7d11) will not change coverage.
The diff coverage is 0.00%.

❗ Current head e771659 differs from pull request most recent head f24e3d6. Consider uploading reports for the commit f24e3d6 to get more accurate results
Impacted file tree graph

@@           Coverage Diff            @@
##             master     #58   +/-   ##
========================================
  Coverage      0.00%   0.00%           
- Complexity      207     218   +11     
========================================
  Files            36      38    +2     
  Lines           876     932   +56     
========================================
- Misses          876     932   +56     
Impacted Files Coverage Δ
src/Factory/PromotionRuleFactory.php 0.00% <0.00%> (ø)
...rc/Form/Type/Rule/HasNotTaxonConfigurationType.php 0.00% <0.00%> (ø)
src/Rule/HasNotTaxonRule.php 0.00% <0.00%> (ø)
src/Rule/HasTaxonRule.php 0.00% <0.00%> (ø)
src/Rule/Rule.php 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 81c7d11...f24e3d6. Read the comment docs.

@igormukhingmailcom igormukhingmailcom merged commit a32a263 into master Oct 12, 2021
@igormukhingmailcom igormukhingmailcom deleted the new-not-in-taxon-rule branch October 12, 2021 14:02
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