public EmployeeDTO GetById(Guid id)
        {
            Employee    employee = _store.GetById(id);
            EmployeeDTO result   = _mapper.Map <EmployeeDTO>(employee);

            SetHiringRate(result, 1);

            if (employee.Team != null)
            {
                result.Team = _mapper.Map <Team, TeamDTO>(employee.Team);
            }

            return(result);
        }
        private Decimal GetTotalHiringRate(Hire hire)
        {
            if (hire.TeamId.HasValue)
            {
                Team team = _teamStore.GetById(hire.TeamId.Value);

                return(_pricePolicyService.CalculateTeamHiringHourPrice(
                           team.Members.Select(e => e.HourRate).ToArray()));
            }

            Employee employee = _employeeStore.GetById(hire.EmployeeId.Value);

            return(_pricePolicyService.CalculateHiringHourPrice(employee.HourRate, 1));
        }