[Shopify] Expose Product facade procedures for Add to Shopify parity#8713
Open
Franco111000 wants to merge 1 commit into
Open
[Shopify] Expose Product facade procedures for Add to Shopify parity#8713Franco111000 wants to merge 1 commit into
Franco111000 wants to merge 1 commit into
Conversation
Add three public procedures to the "Shpfy Product" facade so partners can replicate the native Add to Shopify flow: - ConfirmAddItemToShopify - CheckItemAttributesCompatibleForProductOptions - GetProductUrl for an item and shop The implementation codeunits stay internal; the facade delegates to them and primes the shop where required. Adds facade tests for the attribute check and the product URL lookup.
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.
What & why
The native Add to Shopify action on the Item Card publishes an item through a specific sequence: it confirms the action and resolves the target shop, checks that the item's attributes are compatible with Shopify product options, adds the item, and resolves the product URL. A partner extending the connector cannot reproduce that flow today, because the relevant procedures live on internal codeunits (
Shpfy Sync Products,Shpfy Product Export).This change exposes the missing steps on the existing public
Shpfy Productfacade (codeunit 30234):ConfirmAddItemToShopify(Item; var ShopifyShop)confirms the add and resolves the shop, including the multi-shop selection prompt.CheckItemAttributesCompatibleForProductOptions(Item; ShopifyShop)is the attribute-compatibility check added in v28.GetProductUrl(Item; ShopCode)is the item and shop overload of the existingGetProductUrl.The facade delegates to the existing internal implementations, which stay internal.
CheckItemAttributesCompatibleForProductOptionstakes the shop on the facade and primes the implementation withSetShopbefore delegating, exactly as the native Item Card flow does.Linked work
Fixes #7867
How I validated this
What I tested and the outcome
UnitTestCheckItemAttributesCompatibleForProductOptionsFromFacade(codeunit 139596): calls the facade for an item with more than three "As Option" attributes and confirms it returns false and logs the skipped record, exercising the facade'sSetShopand delegate sequence end to end.UnitTestGetProductUrlForItemFromFacade(codeunit 139604): links a Shopify product holding a URL to an item and confirms the facade returns that URL for the item and shop.ConfirmAddItemToShopifyis a pure passthrough that shows the existing confirmation dialog, so it is covered by the native action's behavior rather than a new interactive test..alpackagesis empty in this fork, following the AL-Go for PTE pattern this repo uses.Risk & compatibility
Shpfy Add Item Confirmpage (30144) setters public. Those setters are internal helpers that the native flow drives only throughShpfy Sync Products.ConfirmAddItemToShopify. Exposing that procedure on the facade gives partners the same entry point the native action uses, including shop selection, while keeping the page's surface internal, so this PR takes that route instead of widening the page. Glad to switch to public page setters if you would prefer to match the issue literally.CheckItemCanBeExportedbetween confirming and the attribute check. If end-to-end parity is wanted, that procedure could be exposed on the facade as well. Happy to add it if the team prefers.