I have simplified the question here to narrow the focus:
What are some recommended approaches to performing validations in the Domain Layer for entity construction when data from a repository is needed?
For example, consider the following validation rule required to pass before an entity is created:
Rule 1: An employee requesting for a cell phone must have worked for ABC Company for 6 months or more
The information available to the Entity in the Domain Layer which originated from a UI and later passed in from an Order Service in the Application Layer does not have enough information to enforce the above sample rule. A query is needed from a repository to return the hire date of the employee to calculate if they have worked for 6 months or more.
The Question
The question is what layer or service should contact a repository at this point to get the employee hire date needed to validate Rule 1? The Domain Entity is not considered valid unless Rule 1 is passes and the entity's other data values pass as well.
Thanks in advance.