mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
While doing that we pass stock changes to the service but we lazy-evaluate them. This way we don't fetch all this data from DB when it might not be used due to an early return. Also, this makes it possible to save the stock-related logic for later. Finally, when changing things to rely on `#initialize_order`'s boolean return value I noticed though, that we were evaluating `proxy_order.order` too early. When instantiating the service object it won't exist yet.