You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several places where GroupOrderArticles are created and/or updated. This happens in different ways. It would be healthy to consolidate that, if possible.
Let's investigate a bit and then see what makes sense.
Member ordering just calls the group order's save_group_order_articles. Here all order articles are iterated, and at the end the group order totals are saved.
Balancing: add & remove ordergroup for order article: this template using goa controller. Here only the result it set, as computation of who gets what is already done, and the order article's result doesn't change anymore.
API /api/v1/group_order_articles (in PR API-4: ordering #573) does something similar as member ordering, but then per group order article.
The text was updated successfully, but these errors were encountered:
I looked it it again, and the moment when OrderArticle#update_results! and GroupOrder#update_price! are called depends on the action that is taken: if multiple products are updated in a group order, GroupOrder#update_price! only needs to be called once at the end (not each time a GroupOrderArticle is modified) - this happens in the regular member ordering screens. And when an OrderArticle is updated among multiple group orders, #update_results! only needs to be called once at the end too (we don't do this currently, as far as I know, but it could be possible).
Perhaps ideally I'd have some kind of system that queues OrderArticle#update_results! and GroupOrder#update_price! for the speciic order article and group order when a GroupOrderArticle is changed, and then at the end of the transaction, all of these queued updates are performed once. We don't have such a system currently. So I think the place for these calls is in the code that requests the GroupOrderArticle updates, which in this case is the controller.
There are several places where
GroupOrderArticle
s are created and/or updated. This happens in different ways. It would be healthy to consolidate that, if possible.Let's investigate a bit and then see what makes sense.
save_group_order_articles
. Here all order articles are iterated, and at the end the group order totals are saved./api/v1/group_order_articles
(in PR API-4: ordering #573) does something similar as member ordering, but then per group order article.The text was updated successfully, but these errors were encountered: