ExESDB.Commanded.Mapper (ex_esdb_commanded v0.4.0)

A mapper for Commanded to use ExESDB as the event store.

Summary

Functions

Converts a Commanded EventData struct to an ExESDB.Schema.NewEvent struct.

Converts an ExESDB.Schema.EventRecord struct to a Commanded RecordedEvent struct.

Converts an ExESDB.Schema.SnapshotRecord struct to a Commanded SnapshotData struct.

Converts a Commanded SnapshotData struct to an ExESDB.Schema.SnapshotRecord struct.

Functions

to_new_event(event_data, event_type_mapper)

@spec to_new_event(
  Commanded.EventStore.EventData.t(),
  ExESDB.Commanded.EventTypeMapper.t()
) ::
  ExESDB.Schema.NewEvent.t()

Converts a Commanded EventData struct to an ExESDB.Schema.NewEvent struct.

to_recorded_event(event_record)

@spec to_recorded_event(ExESDB.Schema.EventRecord.t()) ::
  Commanded.EventStore.RecordedEvent.t()

Converts an ExESDB.Schema.EventRecord struct to a Commanded RecordedEvent struct.

to_snapshot_data(snapshot_record)

Converts an ExESDB.Schema.SnapshotRecord struct to a Commanded SnapshotData struct.

to_snapshot_record(snapshot_data)

Converts a Commanded SnapshotData struct to an ExESDB.Schema.SnapshotRecord struct.