EventsSourcing-on-Azure-Functions
EventsSourcing-on-Azure-Functions copied to clipboard
[Example] Add cross-account bank transfers
In the "bank account" example add a cross account transfer to show how the transaction itself can be backed by an event stream and that can be acted on as a form of saga.
This could also demonstrate the idea of the causation identifier which would link the source withdrawal and the target deposit to the transfer command identifier.
Events:-
- Transfer initiated
- Source funds withdrawn
- Target funds deposited
- Refund initiated
- Source funds refunded
- Refund failed
Projections:-
- Transfer State (Initiated -> Funded -> Transferred / Transfer Failed -> Refunded -> Refund failed)
Classifications:-
- Failed refunds (these might require manual intervention)
Commands:-
- Transfer money
- Cancel in-progress transfer
Queries:-
- GetTransferState - Get the current state from the "Transfer State" projection