Example #1
0
        private GetTopicDetailsOperationResponse.Employee MapEmployee(Domain.Entity.LearningCalendar.Employee employee, Domain.Entity.LearningCalendar.Topic topic)
        {
            var status = _employeeTopicProgressStatusStrategy.GetStatus(employee, topic);

            return(new GetTopicDetailsOperationResponse.Employee
            {
                Id = employee.Id,
                FullName = employee.FullName,
                ProgressStatus = ProgressStatusMapper.MapStatus(status)
            });
        }
Example #2
0
        private GetTopicDetailsOperationResponse.Team MapTeam(Domain.Entity.LearningCalendar.Team team, Domain.Entity.LearningCalendar.Topic topic)
        {
            var employees = team.Employees
                            .Concat(new[] { team.Manager });

            var status = _employeeCollectionTopicProgressStatusStrategy.GetStatus(employees, topic);

            return(new GetTopicDetailsOperationResponse.Team
            {
                TeamId = team.Id,
                ManagerId = team.Manager.Id,
                ManagerFullName = team.Manager.FullName,
                EmployeeCount = status.PlannedEmployees.Count + status.LearnedEmployees.Count + status.OtherEmployees.Count,
                LearnedCount = status.LearnedEmployees.Count,
                PlannedCount = status.PlannedEmployees.Count,
                ProgressStatus = ProgressStatusMapper.MapStatus(status.TotalStatus)
            });
        }
        private GetEmployeeTopicTreeOperationResponse.Topic MapTopic(
            Domain.Entity.LearningCalendar.Topic root,
            Domain.Entity.LearningCalendar.Employee employee)
        {
            var children = root.SubTopics
                           .Select(topic => MapTopic(topic, employee))
                           .ToList();

            var status = _employeeTopicProgressStatusStrategy.GetStatus(employee, root);

            return(new GetEmployeeTopicTreeOperationResponse.Topic
            {
                Id = root.Id,
                ParentId = root.ParentTopicId,
                Subject = root.Subject,
                Description = root.Description,
                Children = children,
                Status = ProgressStatusMapper.MapStatus(status)
            });
        }