How to link an existing event from one stream to another.
Use an event handler to link events of a given type into another stream.
The source event_id is accessible via metadata:
def handle(%ProductSold{} = event, metadata) do
%ProductSold{user_id: user_id} = event
event_id = Map.get(metadata, :event_id)
MyApp.EventStore.link_to_stream(user_id, :any_version, [event_id])
end