CEXT-6421: extract totals-collector into a standalone app#129
Open
obarcelonap wants to merge 15 commits into
Open
CEXT-6421: extract totals-collector into a standalone app#129obarcelonap wants to merge 15 commits into
obarcelonap wants to merge 15 commits into
Conversation
…webhooks/core usage
…totals-collector plan
…d-roll a Commerce client
Splits the 9 total-collector-discounts webhook actions out of the monolith into apps/totals-collector, an independent App Management app built on the same aio-commerce-lib-app/aio-commerce-sdk scaffolding and require-adobe-auth + declarative webhook subscription pattern established in apps/shipping-method. Response construction moves to the SDK's webhook operation builders, and every action gains OpenTelemetry instrumentation via aio-lib-telemetry.
Testing the declarative config object itself isn't valuable — it's a plain data structure, not behavior.
These were internal working plan/spec docs used to drive the totals-collector migration, not meant to land in the codebase.
Member
Author
separate PR to drop the current code |
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.
Description
Extracts the 9 out-of-process discount webhook example actions (
total-collector-discounts)from the checkout starter kit monolith into
apps/totals-collector, a standalone AdobeCommerce App Management app built on
@adobe/aio-commerce-sdk, following the samedomain-split pattern applied to
apps/shipping-method.Highlights of this extraction:
@adobe/aio-commerce-sdk's webhook operation builders(
ok,exceptionOperation,replaceOperation) instead of hand-rolled JSON-patch objects.get_total_modifications.executewebhook slot is declared declarativelyin
app.commerce.config.ts(PaaS and SaaS variants), auto-subscribed at install time — nomanual
webhooks.xmlor admin setup. The 9 actions are alternative example implementationsof that one contract; the config ships with
tiered-quantity-discountas a swappabledefault placeholder.
require-adobe-auth: true; Commerce's signature verification ishandled by the App Management platform rather than a hand-rolled digital-signature check,
matching the pattern validated in
apps/shipping-method. Actions read the already-parsedshippingAssignment/quote/totalwebhook fields directly offparams.@adobe/aio-lib-telemetry.never calls Commerce at all.
Related Issue
CEXT-6421
Motivation and Context
Part of the broader effort to split the checkout starter kit monolith into independently
deployable App Management apps per domain, so each domain (shipping, payment, tax, fees) can
be installed, associated, and versioned on its own.
How Has This Been Tested?
npm test(vitest) covering all 9 discount actions, the shared discount-helper library, therelocated tracking action, and the declarative webhook config.
npx biome check .clean.npm installtriggersaio-commerce-lib-app hooks postinstall, which regeneratessrc/commerce-extensibility-1/.generated/fromapp.commerce.config.tsandinstall.yaml.Screenshots (if appropriate):
N/A
Types of changes
Checklist: