Remove spree_adjustments, replace with {order,line_item,shipment}_{cancellation,discounts,taxes} #4295
Replies: 3 comments 2 replies
-
I support that. It would be much easier for people unfamiliar with the code base and would make code better to unterstand and to maintain. IMO adjustments should stay solely as a manual added change to the order total. That's what we already have an interface and features for (Adjustment Reasons). Would love to hear what others think. |
Beta Was this translation helpful? Give feedback.
-
It's an interesting idea, certainly. My main concern here is that this would create quite the break in compatibility. |
Beta Was this translation helpful? Give feedback.
-
It makes a lot of sense. As you said, it's a lot of work (for sure, more than we can foresee), but if somebody is willing to take it, we can try! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Adjustments are one of the hardest-to-parse models in our code base because they're polymorphic in two directions. The polymorphic nature of the model/table also makes it impossible (or pretty hard) to set good constraints on the database level.
Furthermore, adjustments have to be treated differently when they're discounts or taxes: Discounts have to applied before taxes.
The codebase is pretty full of type checks regarding adjustments:
I think it would be a huge improvement for the readability of the code base. The migration would not be hard to write, even in pure SQL.
What do y'all think?
Beta Was this translation helpful? Give feedback.
All reactions