[Technical] How to use vendor
from Order
entity
#4302
lucasferraro
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With the implementation of Business Account we've created the entity
BusinessRestaurantGroup
which holds all the restaurants that are included in the Platform Catering agreement. The idea withBusinessRestaurantGroup
is that it has all the setup/configuration for all the restaurants to be applied for each order (fulfillment, delivery fees, etc.)With that in mind then we changed the
getVendor
method inOrder
entity so that in case of a Business Account order we return theBusinessRestaurantGroup
associated and with it, we could calculate delivery fees for example.But then, we realized that
getVendor
method is also used to show information about the vendor of the Order like the name, the address, or even the ID to build the path to the vendor page. But for Business Account we face a problem because for configuration/setup information we want theBusinessRestaurantGroup
data, but for name, ID, address, etc we want to have them from the Restaurant where the user/employee has made the order.With that in mind, I've created this PR where now we can use a new method
getSetupVendor
to get the data related to setup/configuration and the existinggetVendor
method will keep its original implementation and should return the "real" vendor information, i.e. for Business Account it will return the restaurant.Beta Was this translation helpful? Give feedback.
All reactions