We're in the phase of rewriting an existing application (not CQRS based). This application has old data that we can use, and must use in the new system. Part of this data is used in the domain, in an aggregate root.
The new axon based system has a more extensive domain model than the old one (more business rules to handle).
One of the business rules is about an event must be received within X days of another event.
The old data has timestamps, so we could do an import which could check the previously mentioned business rule.
At the moment we do an import of all data, converting this data to an command which will be handled by the system. But the previously mentioned business rule could never be triggered, because the timestamp of the command, and the resulting event, will be the timestamp of the current import, and not that of the data of the old system
Is it possible to somehow add metadata to the command (only during import), that will be picked up by the events created, WITHOUT cluttering the code of the aggregate root with "if import then" code paths?
If not, should this be an feature request for axon? Because importing old data is a very common use case, and being able to correctly set the timestamp of the events generated would be a plus, in mine opinion.
I'm very interested in your opinion(s).
Kind regards,
Joep