Skip to content

Event Retrieval and Domain Logic Missing #2

@Brandon2255p

Description

@Brandon2255p

Firstly, thanks for the example and the medium article. I am busy trying to make my own CQRS ES system with go. I have done work on a CQRS ES system in C# but have decided to try learn go and see if it works better.

I see that you do have the function to retrieve events for an aggregate but it is not implemented (not a problem of course)

My main issue is knowing where and how to implement the domain rules. From my experience (which may be wrong), if a command comes in then all the events related to that aggregate ID need to be retrieved and replayed to create an aggregate state. The command can then execute to see if it passes the domain logic. Like to to stop a payment if a certain order has already had its payment executed.

Once the domain logic has passed then the event can be stored and published.

Hope I am on the right track and have not been misled. I would like to know how you would do this. Or if you have a more full example for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions