Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: If Shipping had a cost requirement which service owns that price? #194

Closed
markphillips100 opened this issue Aug 21, 2020 · 2 comments

Comments

@markphillips100
Copy link

Sales appears to own each product's price. If Shipping had a cost associated to each ProductShippingOptionsId would Sales also own that price? My assumptions here are that Sales should own all pricing data, is that wrong to assume?

For example, as a user decides on their required shipping option, after checkout I'm assuming, Sales updates its Order to include new order delivery information, i.e. current option and current price.

If we were to take this a little further and talk about discounts, does Sales also own the how and when the discounts are applied but not necessarily "if" the discounts are applied?

My thinking is in terms of Udi's video talks around Engine Patterns and how he describes a discounting pipeline where other components contribute their own decisions about how much of a discount is applied. So, in our current Sales and Shipping scenario, Sales would trigger (in memory) a discount engine on checkout, and the engine would compose the available discount components (from other services) and execute their logic.

An example of the logic for Shipping might be to track numbers of deliveries per month and give a discount for over 10. I feel shipping owns this logic and the percentage/fixed delivery discount, but not the original delivery (base) price. I'd be interested in your thoughts please.

@mauroservienti
Copy link
Owner

A bit it depends applies here. However,

Sales appears to own each product's price. If Shipping had a cost associated to each ProductShippingOptionsId would Sales also own that price? My assumptions here are that Sales should own all pricing data, is that wrong to assume?

it seems fair to me to say that Shipping, or in any case it's not Sales, owns the cost associated with a shipping option.

If we were to take this a little further and talk about discounts, does Sales also own the how and when the discounts are applied but not necessarily "if" the discounts are applied?

I'd go with the engine pattern as well.

An example of the logic for Shipping might be to track numbers of deliveries per month and give a discount for over 10. I feel shipping owns this logic and the percentage/fixed delivery discount, but not the original delivery (base) price. I'd be interested in your thoughts please.

Sounds legit to me. For each order/delivery an event is received by Shipping allowing it to keep track of the shipment quantity per customer. Shipping, then, participates in the discount engine and can use that number to apply a discount.

@markphillips100
Copy link
Author

Thank you Mauro. I always appreciate your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants