/// <summary> /// Adds a person to CCM using AddPerson behavior call. /// </summary> /// <param name="strategy"></param> /// <param name="applicant"></param> /// <returns></returns> public BaseResult AddPerson(ClientStrategy strategy, Applicant applicant) { var result = new BaseResult(); var lmsPerson = new LmsPerson() { Applicant = applicant }; var addPersonStrategyResult = strategy.AddPerson(lmsPerson); result.AppendResult(addPersonStrategyResult); if (!addPersonStrategyResult.Result) { if (applicant.ApplicantTypeId.GetValueOrDefault() == (int)Akcelerant.Lending.Lookups.Constants.Values.ApplicantType.Joint) { string applicantTypeName = LookupCodes.ApplicantType.Joint; result.AddMessage(MessageType.Warning, $"An error occured adding the {applicantTypeName} Applicant Type. {applicant.FullName} will not be added to CCM."); } else { result.AddError("An error occurred creating the credit card record for the loan. The credit card will not be created in CCM."); return(result); } } return(result); }
/// <summary> /// Adds an authorized user to CCM using AddPerson behavior call. /// </summary> /// <param name="strategy"></param> /// <param name="authorizedUser"></param> /// <returns></returns> public BaseResult AddAuthorizedUser(ClientStrategy strategy, AuthorizedUser authorizedUser) { var result = new BaseResult(); var lmsPerson = new LmsPerson() { AuthorizedUser = authorizedUser }; var addAuthorizedUserStrategyResult = strategy.AddPerson(lmsPerson); result.AppendResult(addAuthorizedUserStrategyResult); if (!addAuthorizedUserStrategyResult.Result) { result.AddMessage(MessageType.Warning, $"An error occured adding the AUTHORIZED USER. {authorizedUser.FirstName} {authorizedUser.LastName} will not be added to CCM."); } return(result); }