persistent-event-source-0.1.0: Persistent based event sourcing.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Persistent.Event.Source.Aggregate

Synopsis

Documentation

class Projection a => Aggregate a where Source #

Aggregate is an intermediate step, allowing you to specify how your changeable commands are stored. stored events should be stable like an API.

Associated Types

type Command a = cmd | cmd -> a Source #

The command is a sumtype with all your possible event sourced actions.

type Actor a Source #

allows you to specify who executed a command. for audit purposes. set this to () if you don't care about this.

Methods

act :: (MonadSqlQuery m, MonadIO m) => Maybe (Actor a) -> Command a -> m [Event a] Source #

Validate action and generate events, if any.