Skip to content

fix(getag): tolerate external_fees_metadata without inputs - #297

Open
chemic wants to merge 7 commits into
mainfrom
fix/getag-fees-optional-inputs
Open

fix(getag): tolerate external_fees_metadata without inputs#297
chemic wants to merge 7 commits into
mainfrom
fix/getag-fees-optional-inputs

Conversation

@chemic

@chemic chemic commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

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.

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-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c1f217

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@epilot/pricing Patch

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

@alexmarqs alexmarqs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Priit Pärna and others added 4 commits September 10, 2026 12:42
…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.
Priit Pärna and others added 2 commits September 10, 2026 17:55
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants