I have an entity model with an embedded credentials document with a username and password property.
- Entities
- ...
- Credentials
- Username
- Password
I currently have validation set on the entities model to ensure that there is no existing username in the database.
My question is: should I put the validation check on a Credentials model or just leave it on the Entities model? An example implementation of the model relationships are shown in this Stack Overflow post: lithium fill multiple models from view