I need to know if an entity (User) matches given some criteria. I have defined the criterions in the domain and they implements an interface:
match(User)bool
Now the problem is one criterion needs the data of the other entity (Company), and User only has the company id.
How should I handle it? Could I create an interface in the domain (CompanyResolver) and use it in the criterion? this interface will be implemented by the repository.
Thanks