MWPW-204225: Support per-OSI promo codes for soft bundle placeholders - #1195
MWPW-204225: Support per-OSI promo codes for soft bundle placeholders#1195Andrei4226 wants to merge 10 commits into
Conversation
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1195 +/- ##
==========================================
+ Coverage 90.71% 90.77% +0.05%
==========================================
Files 318 318
Lines 101712 101768 +56
==========================================
+ Hits 92271 92375 +104
+ Misses 9441 9393 -48
... and 10 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Axelcureno
left a comment
There was a problem hiding this comment.
Nice, per-OSI zip is clean and the wcs tests asserting real URLs are great.
Ran your branch with osi="abm,,stock-abm" and promo="P1,P2,P3": wcsOsi comes back length 2, promotionCodes length 3, and stock-abm requests promotion_code=P2 instead of P3. toOfferSelectorIds drops blanks, toPromotionCodes keeps them, and wcs zips by index. Worth pairing before filtering.
Nit: promotionCodes holds undefined entries where the JSDoc says ''.
Resolves dist conflicts in commerce.js, mas.js, merch-card-collection.js, merch-card.js by rebuilding from source.
Thanks! |
|
Verified, zipping before the blank filter fixes it: One tiny thing on the nit: |
Axelcureno
left a comment
There was a problem hiding this comment.
Verified above, approving. The ?? '' nit is optional.
Branch is conflicting with main, needs a merge before this can land.
seanchoi0
left a comment
There was a problem hiding this comment.
Approving but you should resolve the conflict
# Conflicts: # web-components/dist/commerce.js # web-components/dist/mas.js # web-components/dist/merch-card-collection.js
Resolves https://jira.corp.adobe.com/browse/MWPW-204225
QA Checklist: https://wiki.corp.adobe.com/display/adobedotcom/M@S+Engineering+QA+Use+Cases
Adds support for "soft bundles" to combine multiple offers (e.g. 3 OSI promo codes together) — to each have their own promo code, instead of forcing all offers in the bundle to share a single code.
Example: if a card bundles 3 offers and you want offer 1 to show "PROMO1", offer 2 to show "PROMO2" and offer 3 to show "PROMO3", you can now do that.
Before, you could only apply one promo code to the whole bundle.
Also included: a small cleanup so a promo code list like " CODE1, CODE2 " (extra spaces, stray commas) is parsed correctly instead of keeping the whitespace as part of the code.
Rules for OSI ↔ promo code pairing:
1 OSI + 1 promo code = unchanged: that code applies to that OSI.
osi="A" promo="PROMOCODE1" --> A=PROMOCODE1
Multiple OSIs + exactly 1 promo code = unchanged: broadcasts to all.
osi="A,B,C" promo="PROMOCODE1" --> A=PROMOCODE1, B=PROMOCODE1, C=PROMOCODE1
Multiple OSIs + 2+ promo codes --> paired by position (1st OSI ↔ 1st code, etc).
osi="A,B,C" promo="PROMOCODE1,PROMOCODE2,PROMOCODE3" --> A=PROMOCODE1, B=PROMOCODE2, C=PROMOCODE3
More OSIs than codes --> extra OSIs get no promo code.
osi="A,B,C" promo="PROMOCODE1,PROMOCODE2" --> A=PROMOCODE1, B=PROMOCODE2, C=(none)
More codes than OSIs --> extra codes are ignored.
osi="A,B" promo="PROMOCODE1,PROMOCODE2,PROMOCODE3" --> A=PROMOCODE1, B=PROMOCODE2, (PROMOCODE3 ignored)
A blank OSI slot drops its paired code too, so later OSIs keep their own code.
osi="A,,C" promo="PROMOCODE1,PROMOCODE2,PROMOCODE3" --> A=PROMOCODE1, C=PROMOCODE3 (PROMOCODE2 dropped, not shifted onto C)
Test links:
Studio:
Before: https://mas.adobe.com/studio.html?ost=new#fragmentId=c075f0c7-a08d-4e42-8d45-03a5169dd877&page=fragment-editor&path=sandbox
After: https://mwpw-204225--mas--adobecom.aem.live/studio.html?ost=new#fragmentId=c075f0c7-a08d-4e42-8d45-03a5169dd877&maslibs=MWPW-204225&page=fragment-editor&path=sandbox
Preview:
Before: https://main--milo--adobecom.aem.page/merch/mas/preview?fragment-id=c075f0c7-a08d-4e42-8d45-03a5169dd877&content-type=merch-card&locale=en_US
After: https://main--milo--adobecom.aem.page/merch/mas/preview?fragment-id=c075f0c7-a08d-4e42-8d45-03a5169dd877&content-type=merch-card&locale=en_US&maslibs=MWPW-204225
Before:


After:
Please do the steps below before submitting your PR for a code review or QA
🧪 Nala E2E Tests
Nala tests run automatically when you open this PR.
To run Nala tests again:
run nalalabel to this PR (in the right sidebar)To stop automatic Nala tests:
run nalalabelTest URLs: