private DailyProgressSummary GetDailyProgress(string userId, DateTime dayDate) { var progress = _progressRepository.GetProgress(userId, dayDate, dayDate.AddDays(1)); if (progress.IsNullOrEmpty()) { return(new DailyProgressSummary()); } return(progress.First()); }
public WeeklyProgressSummary BuildWeeklyProgress(string userId, DateTime start, DateTime end) { if (userId.Equals(_localStorage.GetCurrentUserId())) { return(BuildForPlayer(start, end)); } var playersProgress = _progressRepository.GetProgress(userId, start, end); var weeklyProgressSummary = CalculateWeeklyByDays(playersProgress); return(weeklyProgressSummary); }
public DateTime GetLastSyncDate(string userId) { var end = DateTime.Today; var start = end - TimeSpan.FromDays(7); var progress = _progressRepository.GetProgress(userId, start, end); if (progress.IsNullOrEmpty()) { return(start); } return(progress.Last().DayId); }
public List <Progress> GetProgress() { return(_progressRepository.GetProgress()); }