diff --git a/internal/events/proces_events.go b/internal/events/proces_events.go new file mode 100644 index 0000000..e4ea343 --- /dev/null +++ b/internal/events/proces_events.go @@ -0,0 +1,27 @@ +package events + +import ( + "github.com/PiotrFerenc/mash2/internal/types" + "github.com/google/uuid" + "time" +) + +type Event struct { + CreatedAt time.Time + StreamId uuid.UUID +} + +type ProcessEvent interface { + ProcessEvent() *Event +} + +type ProcessCreated struct { + Process types.Process +} + +func (p ProcessCreated) ProcessEvent() *Event { + return &Event{ + CreatedAt: time.Now(), + StreamId: p.Process.Id, + } +} diff --git a/internal/repositories/event-store.go b/internal/repositories/event-store.go new file mode 100644 index 0000000..d313b5c --- /dev/null +++ b/internal/repositories/event-store.go @@ -0,0 +1,7 @@ +package repositories + +import "github.com/PiotrFerenc/mash2/internal/events" + +type EventStore interface { + AddEvent(event events.Event) error +}