-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Subs: totals in backend are consistent and include fee breakdown #2346
Conversation
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.
Makes sense. :-)
else | ||
object.subscription.subscription_line_items.sum(&:total_estimate) | ||
end | ||
return nil unless object.total.present? |
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.
nil
is not needed
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.
Done
3c40ae3
to
a308a2d
Compare
Staged on https://staging1.openfood.com.au/. |
Testing notes: https://docs.google.com/document/d/1p9P4E_4RSX6jnmkJanJ_ai1QYV5jun_vo_JyRIr8p9k/edit# I'll be happy to have maybe another review from @RachL or @sstead as I'm tired and not sure I got it all, but I see two remaining issues:
|
This is worrying. If we don't even know how it should work, the users won't know either. There will probably be a lot of questions. |
So the issue is this: our fee system is so complex that it's virtually impossible to estimate the fees that will apply to an order without actually placing the order. There are so many conditions and different ways of calculating things that attempting to replicate them is just not a viable option for us. The price displayed in the subscriptions interface is intended to be an estimate, because the total for two identical orders placed in different order cycles could be completely different. So the logic just uses the next OC (or most recent if no future OCs exist) to estimate the total. This total is used as the estimate for all future orders. Perhaps the solution to this confusion is just to make it much more clear that the prices displayed in the backend are an estimate only? I will have a look at the issue with the whole order fees, I suspect that I have just not put it any logic to estimate these fees correctly. |
Testing notes Issues seen:
From what I saw actual orders placed were always correct, it's just the predictions that cause concern/confusion. https://docs.google.com/document/d/1ZCEkFBNoXE8M7R9vSzjTyJ60LDa2jXNjRzmsueTjRfg/edit# |
I think the "subscription" is more like a "contract" than an order in term of UX - that vision is also more aligned with CSA people for whom a subscription IS a contract like "I commmit to buy one vegetable basket for 12€ per week for 10 months" for instance. Any subscription is an agreement between a customer and a hub, a commitment to buy something at a certain price (or flexibe price depending on contract) for a certain period of time. I see an issue with updating original contract term by just updating the predictive total if OC changes and loosing original info. It means we would believe afterward that since the begining the contract was that one, even if it changed on the way. I think we would need more steps, like: I'm conscious it is not the way that has been taken here, the logic remains the same but UX would vary a bit. Do you agree about that? I see two option if we want short term decision on what to do:
|
Errr, no. This is a completely new and different set of requirements to the original spec or anything I have heard while working on this. There are definitely ways that we could achieve what you want, and I really like the direction that you're going with this, but I don't want to give the impression that it will be a small change. I didn't design for this at all. We will need to incept carefully and think about the exactly what we need and what the best way of achieving it is. I suspect that reimplementing the concept of price for subscriptions is not going to be a good approach.
At the moment, a subscription is just a list of products + quantities, mapped onto a list of order cycles. All prices come via the order cycles. There is no concept of price at all inside a subscription, so no basis on which to build a price contract. We could definitely change it so that a subscription knows about prices, but I am unclear about whether this means spot prices (OC prices) are overridden or whether we need some way of deciding between the contract price (subscription price) and the spot price. I think they should be completely independent of each other.
This sounds nice, but it is huge. It also sounds like the contracts are not a contract if they need to be continuously amended because the shop updates their enterprise fees. What happens if contracts are not approved? How do we deal with contract disputes?
This is very complex. I think that contact prices should be entirely independent of OC prices. Once prices are set (which can be done in reference to an OC price), that should be the price that should be paid by the given customer until the contract is terminated or it expires. Otherwise we have to deal with the interaction between prices that differ between contracts, and prices in the OC which are what customers who don't have a subscription need to pay. 💥
Yep, we're kind of already doing this part, but not in reference to a contracted price, just in reference to what the user would have been expected to pay if their order was able to be fulfilled for the order cycle in question. |
Ok, agree @oeoeaio let's see in subs v2 how we want to evolve this, but what should we decide for short term solution to solve that feeling of "inconsistency" in order to release quickly? I shared 2 options, but maybe you have others to propose... what do you think Rob and @sstead ? |
this is a friendly poke not to forget about it. |
hi guys - just scanning this to add my 2c about whether it needs to be done before release of subs-1 or not. Seems to me that there is no problem as long as the Enterprise either has an agreement with Customers that they can change fees throughout the subscription cycle, or they can't. And if they have agreed with Customers that they can't, then they don't. Obviously there is a lot of communication between Hubs and Customers about setting up a subscription that isn't being handled in the platform, and we probably just need to make sure the Enterprise Users are very aware of the implications of changing a fee, and clear on whether they have agreed with their Customers that they can or they can't |
@kirstenalarsen I don't disagree, but here what annoy me is the inconsistency in the info that the hub manager read, with no explanation why. I find the UX very poor for the hub manager. In one column ("subscription") she sees info of the original subscription set up for the user with all the details about products, prices, fees, etc. In the other one ("order") she sees the order about to be made but have no detail about this order, so if some changes are made since the subscription was set up (like fees, or product prices) the hub manager can't understand the difference as there are no details. I was not talking about the communication between hub and customer here, only about clarity of the info for the hub manager. |
yep there's room to improve for sure, but at the moment I think things like this need to be clear in the user guide and the hand-holding of beta testers. An order is generated by an order cycle, so if you change product prices or fees in the OC then the actual order price will change. Perhaps it could be a tooltip when the totals are different? |
Yet, at the minimum if we don't want to improve UX now... user guide explanation + maybe a small sentence on the "orders" tab saying "Warning: if you modify enterprise fees on products or orders in your OC, the predicted amount for the orders will diverge from the one in the original subscription set-up. To understand the details of it, check your OC details." could work. |
I guess the workaround would be to change the subscription so that the prices are re-calculated. |
@myriamboure @kirstenalarsen I'm not sure how we should proceed with this. Would you like to create a new issue for some warnings within the admin interface? The problem is that the estimated price is cached. When we change a product price or a fee, we would need to search for all affected subscriptions and re-calculate their estimate. That seems complicated and slow. The other option is to not cache the estimate, but calculate it whenever you look at the subscription. That is probably slow as well (hence Rob cached it). Once we have the Spree upgrade, we can calculate real prices for subscriptions. At that point we can see how fast that is and if we still need to cache it. My verdict is that we deal with the inaccurate values with documentation and hints in the interface and revisit this after the Spree upgrade. |
As I said in my last comment, I'm happy with that in v1, just suggested as well to add a sentence on the orders tab to avoid interrogation from users when they see conflicting info... see above. |
I didn't get a chance to test this today. Feel free to test @myriamboure or @RachL , but no problem if you leave it to Monday when I can look. It's on staging1.openfood.com.au |
Staged on https://staging1.openfood.com.au/. |
@sstead @myriamboure I'm sorry but I won't have time to dive into this one today :( |
@mkllnk @sstead @myriamboure just to be sure, is the sentence the only change being made ? If so, I do see it: |
I guess that's all with @RachL, since last tests only the sentence was added. So if you retested the things from before and the new sentence thing it should all be good then! |
What? Why?
@myriamboure picked up an issue while testing #2122, whereby the estimated totals for subscriptions that included products or shipping/payment methods with fees were not consistently showing the fees in the backend, and when they were, they were not providing a breakdown.
This PR adds a fee breakdown to the
Items
tab, and makes sure that the totals displayed in theOrders
tab are consistent with theItems
tab (ie. they include fees).What should we test?
Orders
tab should always match the total shown in theItems
tab, except when a particular order has been editedRelease notes
This is part of Subscriptions which has not been released yet, so no release notes required.