Repository navigation
feat: add product recommendation rule helpers - #307
Merged
Merged
Conversation
Add extractProductRecommendationRuleRelations and validateProductRecommendationRules with ProductRecommendationRule types, so 360 and targeting-api derive source/offer relations and validate the rule table of a product_recommendation entity the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012h2oEFg2vbGeGsCBZspGn4
🦋 Changeset detectedLatest commit: 34465aa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ProductRecommendationOfferItem and ProductRecommendationOfferGroup are now derived from `Offer` in @epilot/sdk/pricing (the pricing API's spec), so highlight_config is typed as OfferHighlightConfig. Only the rule itself and the offer group id are new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012h2oEFg2vbGeGsCBZspGn4
2.20.114 ships the corrected OfferHighlightConfig (total.format is 'absolute' | 'percentage'), which the product recommendation offer types now reuse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012h2oEFg2vbGeGsCBZspGn4
@epilot/sdk 2.20.115 ships ProductRecommendationRule and ProductRecommendationOfferGroup from the pricing API spec. Re-export them instead of declaring them here, and require @epilot/sdk ^2.20.115. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012h2oEFg2vbGeGsCBZspGn4
paulofph
marked this pull request as ready for review
November 17, 2026 18:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Helpers for the tariff change rule table on
product_recommendation, used by the 360 UI and targeting-api when saving.validateProductRecommendationRules(rules): returns the problems of a table ([]= valid). Codes:RULES_REQUIRED,RULE_SOURCE_REQUIRED,DUPLICATE_SOURCE,MULTIPLE_FALLBACKS,OFFERS_REQUIRED,OFFER_IS_OWN_SOURCE,DUPLICATE_RULE_ID.extractProductRecommendationRuleRelations(rules): returns thesource_products,source_prices,offer_productsandoffer_pricesrelations, de-duplicated (likeextractPricingEntitiesBySlugfor line items).@epilot/sdk/pricing.Generated by Claude Code