Exemple #1
0
        public IActionResult UpdateBusinessPartnerRelationship([FromBody] BpRelationshipUpdateRequest request)
        {
            _logger.LogInformation($"UpdateBusinessPartnerRelationship({nameof(request)}: {request.ToJson()})");

            IActionResult result = BadRequest(ModelState);

            if (ModelState.IsValid)
            {
                try
                {
                    if (HttpContext.Request.Headers.TryGetValue("Authorization", out StringValues jwt))
                    {
                        BpRelationshipUpdateResponse response = _customerLogic.UpdateBPRelationship(request, jwt);
                        result = Ok(response);
                    }
                    else
                    {
                        result = Unauthorized();
                    }
                }
                catch (Exception e)
                {
                    _logger.LogError(e.Message);

                    result = e.ToActionResult();
                }
            }

            return(result);
        }
Exemple #2
0
        /// <summary>
        /// Updates the business partner relationship.
        /// </summary>
        /// <param name="bpRelationshipUpdate">The business partner relationship update.</param>
        /// <param name="jwt">The JWT.</param>
        /// <returns></returns>
        public BpRelationshipUpdateResponse UpdateBPRelationship(BpRelationshipUpdateRequest bpRelationshipUpdate, string jwt)
        {
            _logger.LogInformation($"UpdateBpRelationship({nameof(bpRelationshipUpdate)}: {bpRelationshipUpdate.AccountID1},{bpRelationshipUpdate.AccountID2},{bpRelationshipUpdate.Relationshipcategory}" +
                                   $"{nameof(bpRelationshipUpdate)}: {bpRelationshipUpdate.ToJson()})");


            BpRelationshipUpdateResponse updateStatus = _mcfClient.UpdateBusinessPartnerRelationship(bpRelationshipUpdate, jwt);

            return(updateStatus);
        }