12.24Versioning
Now suppose events can arrive out of order.
Current state:
version 42
status = SUSPENDED
Then stale event arrives:
version 41
status = ACTIVE
If you simply upsert:
status becomes ACTIVE
Wrong.
So store/check:
sourceVersion
and apply only if:
incomingVersion > currentVersion