Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: filter out unchanged taxrates from changed list #1914

Merged
merged 7 commits into from
Sep 19, 2024

Conversation

antoniolodias
Copy link
Contributor

@antoniolodias antoniolodias commented Sep 13, 2024

Summary

support ticket
When trying to update one tax rate inside a tax category, all the tax rates for the tax category are updated by the API.

Description

This happens because there's no update action for taxRates, but only replace, so any taxRate sent to the API is taken to be replaced.

Tried just filtering out from the FE, but that conflicted with remove logic

This PR just filters out unchanged tax rates from the action

Todo

  • Tests
    • Unit
    • Integration
    • Acceptance
  • Documentation
  • Type label for the PR

Copy link

changeset-bot bot commented Sep 13, 2024

🦋 Changeset detected

Latest commit: c92cbac

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

This PR includes changesets to release 1 package
Name Type
@commercetools/sync-actions 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

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.64%. Comparing base (1947ded) to head (c92cbac).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1914   +/-   ##
=======================================
  Coverage   94.63%   94.64%           
=======================================
  Files         147      148    +1     
  Lines        5089     5097    +8     
  Branches     1382     1383    +1     
=======================================
+ Hits         4816     4824    +8     
  Misses        270      270           
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@ajimae ajimae left a comment

Choose a reason for hiding this comment

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

Great job @antoniolodias,

Even though it's not strictly needed, I still think it will be nice if we can add an test assertion to show that the unchanged tax rates were completely omitted in the resulting action.

@ajimae ajimae merged commit 6e1195e into master Sep 19, 2024
9 checks passed
@ajimae ajimae deleted the CKT-2616_update-tax-rate-bug branch September 19, 2024 10:23
@ct-changesets ct-changesets bot mentioned this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants