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

Deprecate Spree::Adjustment#recalculate #5632

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Jan 27, 2024

Summary

We've already deprecated Spree::Adjustment#calculate_eligibility, and we've removed all the code paths that call
Spree::Adjustment#recalculate. Let's deprecate it.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

We've already deprecated Spree::Adjustment#calculate_eligibility, and
we've removed all the code paths that call
Spree::Adjustment#recalculate. Let's deprecate it.
@mamhoff mamhoff requested a review from a team as a code owner January 27, 2024 12:37
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Jan 27, 2024
@mamhoff
Copy link
Contributor Author

mamhoff commented Jan 27, 2024

Requires #5633

Copy link

codecov bot commented Jan 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4b46992) 88.56% compared to head (7ff5b8c) 88.56%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5632   +/-   ##
=======================================
  Coverage   88.56%   88.56%           
=======================================
  Files         685      685           
  Lines       16408    16409    +1     
=======================================
+ Hits        14531    14532    +1     
  Misses       1877     1877           

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

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

👍 For when we're going to write the CHANGELOG for this, can we suggest any replacement for people who are using this method?

@mamhoff
Copy link
Contributor Author

mamhoff commented Feb 12, 2024

👍 For when we're going to write the CHANGELOG for this, can we suggest any replacement for people who are using this method?

In short, no.

Maybe you can formulate something like this:

We've deprecated using Spree::Adjustment#recalculate for recalculating adjustments. Instead, we want to treat adjustments as pure data objects, manipulated by service objects on order recalculation. See the implementations of Spree::OrderTaxation and Spree::Promotion::OrderAdjustmentsRecalculator on how adjustments should be recalculated instead.

@tvdeyen tvdeyen merged commit 928781f into solidusio:main Feb 27, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants