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

Refactor Line Item Total Calculations #6080

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jarednorman
Copy link
Member

Summary

This is related to #5872, but it is not a functional change. It refactors the existing order updater to use a class that we created for the in-memory order updater. The goal here is just to reduce the scope of that PR, though it's also a small design improvement.

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.

@jarednorman jarednorman requested a review from a team as a code owner January 17, 2025 22:26
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Jan 17, 2025
While working on the in-memory updater in solidusio#5872, we found the need to
change how item totals were being calculated, so that we could mark
adjustments for destruction without actually destroying them, while
still keeping tax adjustments intact. This change is completely
backwards-compatible with the current OrderUpdater, so to reduce the
scope of our PR, we wanted to make this change separately.

Since the OrderUpdater is already very large, this helps reduce its
responsibilities and makes it easier to test this behaviour. We don't
see it as necessary to make this a configurable class, but this change
leaves that option open in the future.

Co-authored-by: Adam Mueller <[email protected]>
Co-authored-by: Alistair Norman <[email protected]>
Co-authored-by: Chris Todorov <[email protected]>
Co-authored-by: Harmony Bouvier <[email protected]>
Co-authored-by: Sofia Besenski <[email protected]>
Co-authored-by: benjamin wil <[email protected]>
@jarednorman jarednorman force-pushed the refactor-line-item-total-updates branch from c3214bb to 9a82ff7 Compare January 17, 2025 22:29
@fthobe
Copy link
Contributor

fthobe commented Jan 19, 2025

Hey @jarednorman

Do you think also #1837 could be tackled in #5872 .

Think what you are doing here will also reduce testing time significantly which is also great.

If not we would like to align with you and dedicate some resources to fix #1837 already on your new model.

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.

2 participants