public CreateAccountIPost MapCreateAccountIPost(CreateAccountModelAPI createAccountModelAPI, CreateAccountMessageEntity createAccountMessageEntity) { CreateAccountIPost createAccountIPost = new CreateAccountIPost { Endpoint = EndPoints.KatavuccolAPIUrl.ToString(), Request = createAccountModelAPI }; return(createAccountIPost); }
public Result CreateAccount(CreateAccountMessageEntity createAccountMessageEntity) { CreateAccountModelAPI createAccountModelAPI = profileBusinessServiceMapper.MapCreateAccountModelAPI(createAccountMessageEntity); CreateAccountIPost createAccountIPost = profileBusinessServiceMapper.MapCreateAccountIPost(createAccountModelAPI, createAccountMessageEntity); RestResponse restResponse = katavuccolClient.Post(createAccountIPost); if (restResponse.ResponseContent.IsValid()) { CreateAccountResponseModelAPI createAccountResponseModelAPI = JsonConvert.DeserializeObject <CreateAccountResponseModelAPI>(restResponse.ResponseContent); if (createAccountResponseModelAPI.userId.IsEmpty()) { KatavuccolPortalUtility.GetResult(ResultStatus.Fail, katavuccolPortalWebErrorCode.UserIdIsEmptyFromAPIService, KatavuccolPortalWebConstants.UserIdIsEmptyFromAPIService); } createAccountMessageEntity.UserId = createAccountResponseModelAPI.userId; } else { return(KatavuccolPortalUtility.GetResult(ResultStatus.Fail, katavuccolPortalWebErrorCode.InValidResponseFromAPIAccountCreation, KatavuccolPortalWebConstants.InValidResponseFromAPIAccountCreation)); } return(new Result() { ResultStatus = ResultStatus.Success }); }