Added some constraint and validation for domain entities.