//Update according to ur feature (service request)
        public async Task <ITServerAccessDTO> ProcessRequest(ITServerAccessDTO dto)
        {
            logger.LogDebug($"ProcessRequest method fired {dto.JobID} and {dto.NodeID}");

            if (dto.activity == null)
            {
                dto.activity = await KtaService.TakeActivityAsync(dto.SessionId, dto.DomainModel.JobId, dto.NodeID, dto.EPC);
            }

            if (dto.activity.Identity.NodeId == dto.NodeID && (dto.activity.Identity.NodeId == ConstantNodes.NodeId_ITSystems || dto.activity.Identity.NodeId == ConstantNodes.NodeId_EmployeeToUpdate))
            {
                if (dto.activity.Identity.NodeId == ConstantNodes.NodeId_EmployeeToUpdate)
                {
                    Mapper.Map(dto.ServerDetailsItems, dto.DomainModel.RequiredServersDetails);
                }
                var entity = FindOneById(dto.DomainModel.Id);
                Mapper.Map(dto.DomainModel, entity);
                await UpdateRequest();
            }
            logger.LogDebug($"CompleteActivity method fired SessionId {dto.SessionId} and Username {dto.Requester.Username} and Id { dto.ManagerDecision.Id} and Comment {dto.ManagerDecision.Comment} and Identity {dto.activity.Identity}");

            await KtaService.CompleteActivityAsync(dto.SessionId, dto.Requester.Username, dto.ManagerDecision.Id, dto.ManagerDecision.Comment, dto.activity.Identity);

            return(dto);
        }
        private async Task <ITServerAccessDTO> PrepareDTO(RequestDataModel data)
        {
            //FindOneByJobId(jobId)
            //Inclufe other items so i need querable .include
            ITServerAccessDTO dto = new ITServerAccessDTO();

            dto.DomainModel = await GetQuerable().Where(x => x.JobId == data.JobId).Include(x => x.RequiredServersDetails).FirstOrDefaultAsync();

            var items = dto.DomainModel.RequiredServersDetails;

            dto.ServerDetailsItems = Mapper.Map <List <ServerDetails> >(items);

            return(dto);
        }
        public async Task <ITServerAccessDTO> SaveRequestData(ITServerAccessDTO dto)
        {
            Mapper.Map(dto.ServerDetailsItems, dto.DomainModel.RequiredServersDetails);
            await AddNewRequest(dto.DomainModel);

            logger.LogDebug($"SessionId {dto.SessionId} , process ID {AppConfiguaraton.ITServerAccessProcessID} , DomainModel.Id {dto.DomainModel.Id} ");

            dto.DomainModel.JobId = await KtaService.CreateJobAsync(dto.SessionId, AppConfiguaraton.ITServerAccessProcessID, dto.DomainModel.Id);

            logger.LogDebug($"Create Job ID fired {dto.DomainModel.JobId}");
            await UpdateKtaJobID(dto.DomainModel.Id, dto.DomainModel.JobId);

            logger.LogDebug($"Create Job ID fired {dto.DomainModel.JobId}");
            return(dto);
        }