I am totally inexperienced in modelling or DDD approach. Below description could point out to my lack of knowledge about how entities, aggregates or microservices work.
Background
So, I have a domain for invoices, where an Invoice object is an Aggregate Root. I also have a domain with person's billing or shipping data, called Person.
My Invoice model is being created by use of simple event sourcing. Let's say that i have an InvoiceCreated event, with invoice ID, issuing person ID, status and creation date:
class InvoiceCreated {
private string id;
private string issuerId;
private string status;
private Date dateCreated;
However, my Invoice entity does not contain the ID of issuer, but the whole Value:
class Invoice {
private string id;
//...
private Issuer issuer;
The Issuer class is just a VO created from another domain Entity. Both domains communicate with each other by REST API.
The problem
I am recreating an Invoice entity from events, which has only ID of objects from another domains. I do not have direct access to this data from my Invoice domain. My aggregate root has apply method which applies and records events. So, in order to correctly apply mentioned event, I need to have data of Person that is creating (issuing) this invoice.
Possible solutions
I am thinking about supplying my aggregate root with some kind of service/API client that would retrieve this data from the outside. It would make an API call for this data, and then store this in Redis for the time of replaying events, and then invalidate the cache.
Main con of this approach is immutability of my event - in case of Person's model change all I have to do is change in Invoice's Person value - no need to alter event at all, no need to create a new version of event.
But I am afraid about correctness of this approach. The idea seems pretty good and right for me, but implementation confuses me a bit. I am thinking about breaking the SRP rule with this approach and making a mess in code.
What do you think? Maybe it's my model which is wrong? Or is this right thing to do in that case? I am not using any event handlers, or event bus - it is a very simple case and I thought that it is not a bad thing to apply events in aggregate itself and uses them as event store entries as well.