-
-
Notifications
You must be signed in to change notification settings - Fork 725
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
Move all Calculators from spree to OFN and out of the Spree namespace #5613
Move all Calculators from spree to OFN and out of the Spree namespace #5613
Conversation
Relevant failing specs and a merge conflict, moving to in dev. Looks good though 😄 |
fbfc5a8
to
2f28c39
Compare
yes, there was a problem in the last refactoring and also conflicts with #5492, all resolved now. Ready for review again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! 👏
db/migrate/20200616162646_move_all_calculators_outside_the_spree_namespace.rb
Show resolved
Hide resolved
c2c5090
to
1da1a39
Compare
rebased to resolve conflicts. |
rebased to resolve conflict in schema.rb |
More conflicts... |
…to be used by the app and make spree specs use calculators outside the spree namespace
spree code and is not necessary here now)
ok, rebased to resolve conflicts. Ready for review again. |
build is good, just flaky. |
I just rebuilt it to get a green build. I think we can move it to test ready afterwards. |
It needs a second review, right? |
yes, it does but... last time we heard from someone else was 22 days ago and I think most of the changes are rather simple. |
🎉 🎉 🎉 🎉 |
Hey @luisramos0 , Thank your for the detailed testing notes! Before staging this PR I've set enterprise fees, of all available kinds: p1 - Flat percent (per item) Test cases/steps:
Then, I staged this PR:
After setting "charges GST" in the for that hub, and by changing the Tax category of the different enterprise fees (inheriting from product or others) apply taxes over:
This worked as expected. Also checked if calculators still work correctly on shipping/payment methods. I followed your testing notes:
The calculators rendered the expected value for each order; fees operate on the price per item without including the respective enterprise fee, for example, Price Sack, or flat-percent - this is a known issue:
This PR really touches a lot of corners of the app!
rspec ./spec/models/variant_override_spec.rb:36 # VariantOverride scopes fetching variant overrides indexed by variant does not include overrides for soft-deleted variants |
bam 💥 , merged |
What? Why?
Closes #5687
Something I wanted to do for a long time.
We move all needed code from core/app/models/spree/calculator to OFN. And then we move what's in app/models/spree/calculator to app/models/calculator where there are already 2 calculators 👌
What should we test?
First of all we need to verify that the calculators defined before this PR is deployed will still work correctly after the deployment of this PR. For example, create an order with some fees (with specific calculators, for example, flat_rate). After deploying this PR, go to admin/orders and press "Update and recalculate fees", the fees should still be correct.
We need to make a simple verification of each calculator in each part of the app where they are used. Maybe not a multiplication of these two things but for example:
Release notes
Changelog Category: Changed
Simplified a lot the calculators code used to calculate taxes and fees in OFN.