public IActionResult Update(string id, KanbanUserStory kanbanUSIn)
        {
            var kanbanUS = _userService.Get(id);

            if (kanbanUS == null)
            {
                return(NotFound());
            }
            //user story name change
            // subtask add delete change
            // task add delete
            // acceptance critera add del
            // start end point changed

            _userService.Update(id, kanbanUSIn);

            if (kanbanUS.shortName != kanbanUSIn.shortName)
            {
                Logger actlog = new Logger()
                {
                    type        = "Activity@UpdateCard",
                    id          = HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value,
                    description = _user1Service.Get(HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value).username + " changed title from "
                                  + kanbanUS.shortName + " to " + kanbanUSIn.shortName,
                    published = DateTime.Now,
                    projectId = kanbanUSIn.projectId,
                    data      = new Data()
                    {
                        id   = kanbanUSIn.Id,
                        name = kanbanUSIn.shortName
                    }
                };
                RabbitMQProducer actProducer = new RabbitMQProducer();
                actProducer.SendMessageToActivityLogger(actlog);
            }
            else if (kanbanUS.startTime != kanbanUSIn.startTime)
            {
                Logger actlog = new Logger()
                {
                    type        = "Activity@UpdateCard",
                    id          = HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value,
                    description = _user1Service.Get(HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value).username + " changed start time from "
                                  + kanbanUS.startTime + " to " + kanbanUSIn.startTime,

                    projectId = kanbanUSIn.projectId,
                    published = DateTime.Now,
                    data      = new Data()
                    {
                        id   = kanbanUSIn.Id,
                        name = kanbanUSIn.shortName
                    }
                };
                RabbitMQProducer actProducer = new RabbitMQProducer();
                actProducer.SendMessageToActivityLogger(actlog);
            }
            else if (kanbanUS.endTime != kanbanUSIn.endTime)
            {
                Logger actlog = new Logger()
                {
                    type        = "Activity@UpdateCard",
                    id          = HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value,
                    description = _user1Service.Get(HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value).username + " changed end time from "
                                  + kanbanUS.endTime + " to " + kanbanUSIn.endTime,
                    projectId = kanbanUSIn.projectId,
                    published = DateTime.Now,
                    data      = new Data()
                    {
                        id   = kanbanUSIn.Id,
                        name = kanbanUSIn.shortName
                    }
                };
                RabbitMQProducer actProducer = new RabbitMQProducer();
                actProducer.SendMessageToActivityLogger(actlog);
            }
            else if (kanbanUSIn.points != kanbanUSIn.points)
            {
                Logger actlog = new Logger()
                {
                    type        = "Activity@UpdateCard",
                    id          = HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value,
                    description = _user1Service.Get(HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value).username + " changed points from "
                                  + kanbanUS.points + " to " + kanbanUSIn.points,
                    published = DateTime.Now,
                    projectId = kanbanUSIn.projectId,
                    data      = new Data()
                    {
                        id   = kanbanUSIn.Id,
                        name = kanbanUSIn.shortName
                    }
                };
                RabbitMQProducer actProducer = new RabbitMQProducer();
                actProducer.SendMessageToActivityLogger(actlog);
            }
            else if (kanbanUS.acceptanceCriteria != null)
            {
                if (kanbanUS.acceptanceCriteria.Length > kanbanUSIn.acceptanceCriteria.Length)
                {
                    Logger actlog = new Logger()
                    {
                        type        = "Activity@UpdateCard",
                        id          = HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value,
                        description = _user1Service.Get(HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value).username + " deleted an acceptance criteria",
                        published   = DateTime.Now,
                        projectId   = kanbanUSIn.projectId,
                        data        = new Data()
                        {
                            id   = kanbanUSIn.Id,
                            name = kanbanUSIn.shortName
                        }
                    };
                    RabbitMQProducer actProducer = new RabbitMQProducer();
                    actProducer.SendMessageToActivityLogger(actlog);
                }
                else if (kanbanUS.acceptanceCriteria.Length < kanbanUSIn.acceptanceCriteria.Length)
                {
                    Logger actlog = new Logger()
                    {
                        type        = "Activity@UpdateCard",
                        id          = HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value,
                        description = _user1Service.Get(HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value).username + " added an acceptance criteria",
                        published   = DateTime.Now,
                        projectId   = kanbanUSIn.projectId,
                        data        = new Data()
                        {
                            id   = kanbanUSIn.Id,
                            name = kanbanUSIn.shortName
                        }
                    };
                    RabbitMQProducer actProducer = new RabbitMQProducer();
                    actProducer.SendMessageToActivityLogger(actlog);
                }
            }

            else if (kanbanUS.tasks != null)
            {
                if (kanbanUS.tasks.Length > kanbanUSIn.tasks.Length)
                {
                    Logger actlog = new Logger()
                    {
                        type        = "Activity@UpdateCard",
                        id          = HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value,
                        description = _user1Service.Get(HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value).username + " deleted a task",
                        published   = DateTime.Now,
                        projectId   = kanbanUSIn.projectId,
                        data        = new Data()
                        {
                            id   = kanbanUSIn.Id,
                            name = kanbanUSIn.shortName
                        }
                    };
                    RabbitMQProducer actProducer = new RabbitMQProducer();
                    actProducer.SendMessageToActivityLogger(actlog);
                }
                else if (kanbanUS.tasks.Length < kanbanUSIn.tasks.Length)
                {
                    Logger actlog = new Logger()
                    {
                        type        = "Activity@UpdateCard",
                        id          = HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value,
                        description = _user1Service.Get(HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value).username + " added a task",
                        published   = DateTime.Now,
                        projectId   = kanbanUSIn.projectId,
                        data        = new Data()
                        {
                            id   = kanbanUSIn.Id,
                            name = kanbanUSIn.shortName
                        }
                    };
                    RabbitMQProducer actProducer = new RabbitMQProducer();
                    actProducer.SendMessageToActivityLogger(actlog);
                }
                // else
                // {
                //     for(var i in kanbanUS.)

                // }
            }



            KanbanData kanbanobj = new KanbanData()
            {
                Id                 = kanbanUSIn.Id,
                action             = "put",
                uniqueId           = kanbanUSIn.uniqueId,
                description        = kanbanUSIn.description,
                shortName          = kanbanUSIn.shortName,
                projectId          = kanbanUSIn.projectId,
                userId             = kanbanUSIn.userId,
                status             = kanbanUSIn.status,
                startTime          = kanbanUSIn.startTime,
                endTime            = kanbanUSIn.endTime,
                linkedToId         = kanbanUSIn.linkedToId,
                assignedTo         = kanbanUSIn.assignedTo,
                acceptanceCriteria = kanbanUSIn.acceptanceCriteria,
                points             = kanbanUSIn.points,
                tasks              = kanbanUSIn.tasks,
                progress           = kanbanUSIn.progress
            };

            RabbitMQProducer prod = new RabbitMQProducer();

            Console.WriteLine(JsonConvert.SerializeObject(kanbanobj));
            prod.ProduceMessageToGantt(kanbanobj);


            Logger log = new Logger()
            {
                type        = "KanBan@UpdateCard",
                id          = HttpContext.User.Claims.Where(c => c.Type == "id").FirstOrDefault().Value,
                description = "Card Updated",
                published   = DateTime.Now.Add(new TimeSpan(0, 5, 30, 0)),
                projectId   = kanbanUSIn.projectId,
                data        = new Data()
                {
                    id   = kanbanUSIn.Id,
                    name = kanbanUSIn.shortName
                }
            };
            RabbitMQProducer producer = new RabbitMQProducer();

            producer.SendMessageToLogger(log);
            Console.WriteLine(log);

            return(NoContent());
        }