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
We are using Medusa 1.17.4, there are fields like order.total, order.subtotal,.. that are not saved to database. They are recalculated by orderService.decorateTotals method. Several questions arise:
Do we expect these totals to change after the order was created or was last edited? For example: if we create an order 1 year ago, and there has been no change to the order, should we expect the totals to remain the same?
If we expect the totals to remain the same when there is no edit, should we just store the totals and avoid recalculation (to avoid bugs)?
Other issues caused by this are related to performance: in order to aggregrate on these totals, we cannot just aggregrate easily with a query to the database, we need to load the orders to aggregate on server side. It causes performance issues (also memory usage) when there are many orders.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Medusa team,
We are using Medusa 1.17.4, there are fields like
order.total
,order.subtotal
,.. that are not saved to database. They are recalculated byorderService.decorateTotals
method. Several questions arise:Thanks,
Khanh
Beta Was this translation helpful? Give feedback.
All reactions