I have a simple toy project that deals with Banking operations (cash deposit, withdrawals, wire transfers, open and close accounts).
I am wondering whether there is something wrong about saving invalid operations.
Say the command sent (eg. withdraw cash command) to the Event Sourced system is flawed, for example the bank account for withdrawing cash does not have enough funds or the account id is invalid / does not exist.
Does the result of a validation can be saved in the event store as well as some sort of
Invalid Operation Attempted?
My point is that let's imagine that those event can somehow have a business value (can make a projection and count how many invalid operations have happened and whatnot) so they can be saved and not just be part of the log?