Basically I've a pipeline that handles elevator disruption events. Currently there are two sources for events: the remote API and the event store (for already happened events).
API source: https://github.com/Akii/elescore/blob/master/src/Elescore/Integration/DB.hs#L32
Store source: https://github.com/Akii/elescore/blob/master/src/Elescore/Pipeline.hs#L37
I run "projections" aka folds on those events. So when starting the program I replay previous events:
https://github.com/Akii/elescore/blob/master/src/Elescore/Pipeline.hs#L47