Search⌘ K
AI Features

Order Processing and Payments State Transfer

Explore how event-carried state transfer refactors order processing and payment modules by replacing synchronous calls with domain event handlers. Understand how this decoupling improves module independence, supports asynchronous workflows, and facilitates sending notifications and updating orders when invoices are paid.

Order processing state transfer

We refactored the Order Processing module, extracting side effects from the command handlers into domain event handlers. One of those domain event handlers was for the notifications we wanted to send out when specific changes were made to the Order aggregate:

The notification requests sent from the Order Processing module
The notification requests sent from the Order Processing module

Replacing the calls from the Order Processing module will not result in us creating a data cache in the Notifications module. Instead, a reaction to the ...