-
I have an electronic wallet, where each user has a pocket with money and can transfer money to another user. Case: When a user transfer money the system creates a transaction, and on another hand when a user receives the money there is also another transaction. So at the final, the entire process creates two transactions (one per user) with almost the same data. Both transactions are stored with a groupUuid in order to know the correlation and causation transactions. Problem: How could I make the Event according to event sourcing? Possible solutions:
The first solution is better for me, according to the book, an event is a source of truth and it has all the entire process. Both options would work well, it's just a logic problem. Which option looks better? What do you think? Thanks :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Always choose what's closest to the real-world problem. In this case one transaction is creation, from someone, to someone. So it's one event with two (and more) fields. |
Beta Was this translation helpful? Give feedback.
Always choose what's closest to the real-world problem. In this case one transaction is creation, from someone, to someone. So it's one event with two (and more) fields.