moqui / mantle-usl

Mantle Universal Service Library
http://www.moqui.org/mantle.html
Other
29 stars 61 forks source link

Not having a Facility defined for a Product should not be treated as an error #210

Open eigood opened 1 month ago

eigood commented 1 month ago

https://github.com/moqui/mantle-usl/blob/3b492bff368aeb633d975a5bba3b2276dc9232b7/service/mantle/order/OrderServices.xml#L2874

If there is no Facility defined for a product, then this line should just return, and not treat it as an error. In this case, drop-ship isn't wanted. This service is called via SECA on all orders, when they transition to Approved status, so needs to handle all cases.

(This actually failed on me, when I attempted to place an order on an existing product that hadn't been matched to a facility yet)

eigood commented 1 month ago

This branch also fails if purchasing a digital product, that will never have an asset. Basically, you're adding a forced call out to the create#DropShip service, for all orders being placed, and then returning error when the invariants necessary for drop ship to function are not found. That's going to cause a lot of breakage for existing users.

Don't return error in any case, and ideally, don't spam the log with "can't do drop-ship foo because of bar", for existing flows.

eigood commented 1 month ago

Please try this against upstream demo data.