}
UserDTO customer;
try{
customer = retrieveUserRecord(invitation.getCustomer());
}catch(UserNotFoundException e){
throw new UserNotFoundException(
"Customer with ssn "+ invitation.getCustomer().getSsn()+" cannot be found.");
}
// check if agent exists
if (invitation.getAgent() == null) {
throw new IllegalArgumentException("Invitation must include agent.");
}
UserDTO agent;
try{
agent = retrieveUserRecord(invitation.getAgent());
} catch(UserNotFoundException e){
throw new UserNotFoundException(
"Agent with ssn " + invitation.getAgent().getSsn() + " cannot be found.");
}
// record & send invitation
// TODO: no invitation is actually mailed.