fix(getag): tolerate external_fees_metadata without inputs - #297
Open
chemic wants to merge 7 commits into
Open
Conversation
processExternalFeesDetails threw 'Cannot read properties of undefined (reading consumptionHT)' for order line items whose getag fee metadata has no inputs object. Make inputs optional, guard the reads, and add regression tests.
🦋 Changeset detectedLatest commit: 0c1f217 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 |
…is missing Add resolveExternalFeesType(): inputs.type, then commodity-specific breakdown keys, then the price getag category, then power. Verivox journey orders carry no inputs and several attach gas compute results to power prices.
… coverage Updated the logic in processExternalFeesDetails to prioritize the getag category over breakdown fees when inputs are missing. Adjusted related tests to reflect this change, ensuring that gas fees are excluded when a power category is present. Additionally, refactored the resolveExternalFeesType function to simplify the determination of fee types based on the price item's getag category.
Introduced a new test case in resolveExternalFeesType to verify that the function correctly uses a composite component category even when the component omits the optional type. This enhances test coverage for scenarios involving composite price items.
Updated the documentation for the inputs property in ExternalFeesMetadata to provide a clearer description. Removed unnecessary details about consumption inputs being attached only by the journey app, streamlining the comment for better readability.
paulofph
approved these changes
Sep 10, 2026
The resolver was reworked to follow the price's getag category instead of inferring the commodity from breakdown keys; align the changeset with that behaviour. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
alexmarqs
approved these changes
Sep 10, 2026
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.
processExternalFeesDetails threw 'Cannot read properties of undefined (reading consumptionHT)' for order line items whose getag fee metadata has no inputs object. Make inputs optional, guard the reads, and add regression tests.