public IActionResult GetTimeTracking(int teamId, int year, int month) { try { if (!resourceAccess.CanGetTeamReports(GetUserClaims(), teamId)) { return(Unauthorized()); } return(Ok(timeTracking.GetTeamMonthReport(teamId, year, month))); } catch (Exception ex) { return(HandleException(ex)); } }
private List <TeamMemberDashboardModel> GetTeamMembersDashboard(Team team, int year, int month) { List <EmployeeTimeModel> employeeTimes = _timeTracking.GetTeamMonthReport(team, year, month); List <TeamMemberDashboardModel> teamMembers = new List <TeamMemberDashboardModel>(); foreach (EmployeeTimeModel employeeTime in employeeTimes) { teamMembers.Add(new TeamMemberDashboardModel { Employee = employeeTime.Employee, TotalHours = employeeTime.TotalHours, Overtime = employeeTime.Overtime, PaidTimeOff = employeeTime.PaidTimeOff, WorkingHours = employeeTime.HourTypes["Workday"], MissingEntries = employeeTime.HourTypes["Missing entries"] }); } return(teamMembers); }