Event sourcing example code