Before events where published and received with unstructured payloads; based on the type the consumer would need to infer what the payload of the event should be. This made the events hard to understand, and also easy to make mistakes in.
This PR changes this by turning the events into explicit structs that contain the payload. That way the payload is coupled to the event type.
Additionally this PR further cleans up the event related packages. Moving the API-specific things (events, aggregates) to the API package.
Before events where published and received with unstructured payloads; based on the type the consumer would need to infer what the payload of the event should be. This made the events hard to understand, and also easy to make mistakes in.
This PR changes this by turning the events into explicit structs that contain the payload. That way the payload is coupled to the event type.
Additionally this PR further cleans up the event related packages. Moving the API-specific things (events, aggregates) to the API package.