public IActionResult CreateCustomerInteractionRecord([FromBody] CreateCustomerInteractionRequest createCustomerInteraction) { _logger.LogInformation($"CreateCustomerInteractionRecord({nameof(createCustomerInteraction)}: {createCustomerInteraction.ToJson()}"); IActionResult result; Task <GetCustomerInteractionResponse> customerProfile = null; try { HttpContext.Request.Headers.TryGetValue("Authorization", out StringValues jwt); customerProfile = _customerLogic.CreateCustomerInteractionRecord(createCustomerInteraction, jwt); if (customerProfile.Result.Success == "true") { result = Ok(customerProfile); } else { result = BadRequest(customerProfile); } } catch (Exception e) { _logger.LogError(e, e.Message); result = e.ToActionResult(); } return(result); }
public async Task CreateCustomerInteractionRecord_CanCreateRecord() { // Arrange var user = TestHelper.ActiveInteractionUser; var loginResponse = await AuthClient.GetJwtToken("donaldmcconnell", "Start@123"); user.SetJwtEncodedString(loginResponse.Data.JwtAccessToken); user.JwtEncodedString.ShouldNotBeNullOrWhiteSpace(); user.BPNumber.ShouldNotBe(0); CreateCustomerInteractionRequest newInteraction = new CreateCustomerInteractionRequest() { AccountID = "1001840105", Description = "High Bill Call", PremiseID = 7000006028, BusinessAgreementID = 200000053856, Priority = 5, InteractionRecordReasonID = "A1-ZBIL -HIGH", InteractionRecordCategory1 = "", InteractionRecordCategory2 = "", InteractionRecordCategory1GUID = "", InteractionRecordCategory2GUID = "", ChannelID = "Z14", Note = "Insert Notes for the IR", IncomingFlag = true, DocumentStatusID = "E0003" }; GetCustomerInteractionResponse response = McfClient.CreateCustomerInteractionRecord(newInteraction, user.JwtEncodedString); Assert.AreEqual(response.Success, "True"); Assert.IsNotNull(response.InteractionRecordID); }
/// <summary> /// Create customer interaction record through Cassandra /// </summary> /// <param name="createCustomerInteraction">Interaction record</param> /// /// <param name="Jwt"></param> /// <returns>Awaitable CustomerProfileModel result</returns> public async Task <GetCustomerInteractionResponse> CreateCustomerInteractionRecord(CreateCustomerInteractionRequest createCustomerInteraction, string jwt) { GetCustomerInteractionResponse interactionResponse = _mcfClient.CreateCustomerInteractionRecord(createCustomerInteraction, jwt); return(interactionResponse); }