You want to implement cross-entity validation
The problem
The solution
Parent topic:
Coding service-layer implementations