Exemplo n.º 1
0
        private GetSubordinateTopicTreeOperationResponse.Topic MapToResponse(
            Domain.Entity.LearningCalendar.Topic topic,
            List <Domain.Entity.LearningCalendar.Employee> employees)
        {
            var status = _employeeCollectionTopicProgressStatusStrategy.GetStatus(employees, topic);

            return(new GetSubordinateTopicTreeOperationResponse.Topic
            {
                Id = topic.Id,
                Subject = topic.Subject,
                Description = topic.Description,
                Children = topic.SubTopics.Select(subTopic => MapToResponse(subTopic, employees)).ToList(),
                PlannedEmployees = status.PlannedEmployees.Select(MapEmployee).ToList(),
                LearnedEmployees = status.LearnedEmployees.Select(MapEmployee).ToList(),
                NotPlannedEmployees = status.OtherEmployees.Select(MapEmployee).ToList(),
                TotalStatus = MapStatus(status)
            });
        }
Exemplo n.º 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)
            });
        }