Skip to content

remove calculate total offer from offer aggregate 2 #452

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lukaszreszke
Copy link
Collaborator

  • Introduce new assertion
  • Publish OrderTotalValueCalculated from CalculateTotalValue

Instead of publishing this event from the aggregate now we're going to
publish it from the event handler. This is temporary. Ideally we'd have
an calculator for that that would subscribe to all the events that
affect the offer.

Additionally we'll get benefits from both of suggested solutions up
until now:
- we'll remove calculate_order_total_value from aggregate in next
  commits
- read models are going to subscribe to whatever is published from
  CalculateTotalValue and won't have to calculate anything on their own
- in next steps the events such as PriceItemAdded, PriceItemRemoved will
  get rid of base_total_value and total_value
- change is going to be simpler as the event stands still, it is just
  going to be produced by different component. One that will be
  responsible for doing calculations. This way we'll make Offer care
  only about items and promotions for the offer, not the price itself.
Copy link

netlify bot commented Jun 2, 2025

Deploy Preview for ecommerce-events ready!

Name Link
🔨 Latest commit b9a990f
🔍 Latest deploy log https://app.netlify.com/projects/ecommerce-events/deploys/683d44f7da2d9f00086a04a0
😎 Deploy Preview https://deploy-preview-452--ecommerce-events.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Successfully merging this pull request may close these issues.

1 participant