Beispiel #1
0
        public TimeTrackerOptions getTimeTrackerOptions()
        {
            var timeTrackerOptions = new TimeTrackerOptions();

            config.GetSection("TimeTracker").Bind(timeTrackerOptions);
            return(timeTrackerOptions);
        }
Beispiel #2
0
        public TeamHoursRepository(
            ILogger <TeamHoursRepository> logger,
            IOptions <TimeTrackerOptions> timeTrackerOptions,
            IUserContext userContext,
            GraphAppUserService graphUserService,
            GraphAppSharePointService graphSharePointService,
            GraphAppCalendarService graphCalendarService,
            GraphAppTasksService graphTasksService,
            GraphAppMailService graphMailService,
            IWorkflowService <WorkHours> workHoursWorkflowService,
            ICacheService <ListCollectionPage <TeamHours> > teamHoursCache,
            ICacheService <ListCollectionPage <GraphResultItem> > directReportsCache)
        {
            _logger                   = logger ?? throw new ArgumentNullException(nameof(logger));
            _timeTrackerOptions       = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _userContext              = userContext ?? throw new ArgumentNullException(nameof(userContext));
            _graphUserService         = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
            _graphSharePointService   = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
            _graphCalendarService     = graphCalendarService ?? throw new ArgumentNullException(nameof(graphCalendarService));
            _graphTasksService        = graphTasksService ?? throw new ArgumentNullException(nameof(graphTasksService));
            _graphMailService         = graphMailService ?? throw new ArgumentNullException(nameof(graphMailService));
            _workHoursWorkflowService = workHoursWorkflowService ?? throw new ArgumentNullException(nameof(workHoursWorkflowService));
            _teamHoursCache           = teamHoursCache ?? throw new ArgumentNullException(nameof(teamHoursCache));
            _directReportsCache       = directReportsCache ?? throw new ArgumentNullException(nameof(directReportsCache));

            _teamHoursDataList = new List <TeamHours>();
        }
 /// <summary>
 /// Constructor
 /// </summary>
 public GraphAppSharePointService(
     IGraphAuthProvider authProvider,
     IUserContext userContext,
     TimeTrackerOptions timeTrackerOptions) : base(authProvider, userContext)
 {
     _timeTrackerOptions = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
 }
 public AnalyticsRepository(
     TimeTrackerOptions timeTrackerOptions,
     GraphAppSharePointService graphSharePointService)
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
 }
Beispiel #5
0
 public TimezoneHelper(
     ILogger <TimezoneHelper> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions)
 {
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _timeZone           = GetValidatedTimezone();
 }
 public TeamHoursService(
     IGraphAuthProvider authProvider, GraphAppSharePointService graphAppSharePointService,
     IUserContext userContext,
     TimeTrackerOptions timeTrackerOptions, TeamHoursRepository teamHoursRepository) : base(authProvider, userContext)
 {
     _timeTrackerOptions  = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _teamHoursRepository = teamHoursRepository ?? throw new ArgumentNullException(nameof(teamHoursRepository));
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public GraphTasksService(
     IGraphAuthProvider authProvider,
     IUserContext userContext,
     ILogger <GraphTasksService> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions) : base(authProvider, userContext)
 {
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logger">The logging provider to use</param>
 /// <param name="timeTrackerOptions">The app settings provider</param>
 public MonthlyReportHoursService(IGraphAuthProvider authProvider,
                                  IUserContext userContext,
                                  TimeTrackerOptions timeTrackerOptions,
                                  ReportHoursRepository reportHoursRepository)
 {
     _timeTrackerOptions    = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _reportHoursRepository = reportHoursRepository ?? throw new ArgumentNullException(nameof(reportHoursRepository)); // For HR
     //_notificationsRepository = notificationRepository ?? throw new ArgumentNullException(nameof(notificationRepository));
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public WorkflowServiceHelper(
     TimeTrackerOptions timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     UserProfileRepository userProfileRepository)
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _userProfileRepository  = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
 }
Beispiel #10
0
 public RefreshHoursTask(
     TimeTrackerOptions timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     Microsoft.Azure.WebJobs.ExecutionContext context)
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
Beispiel #11
0
 /// <summary>
 /// Constructor
 /// </summary>
 public GraphAppTasksService(
     IGraphAuthProvider authProvider,
     IUserContext userContext,
     // ILogger<GraphAppTasksService> logger,
     TimeTrackerOptions timeTrackerOptions,
     string userObjectIdentifier) : base(authProvider, userContext)
 {
     // _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions   = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userObjectIdentifier = userObjectIdentifier;
 }
 public AnalyticsRepository(
     ILogger <AnalyticsRepository> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
 }
Beispiel #13
0
        public DirectReportsMemoryCache(
            ILogger <DirectReportsMemoryCache> logger,
            IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
            IMemoryCache memoryCache)
        {
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _memoryCache        = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));

            _cacheTime = _timeTrackerOptions.WorkHoursCacheMinutes;
        }
        public NotificationsMemoryCache(
            ILogger <NotificationsMemoryCache> logger,
            IOptions <TimeTrackerOptions> timeTrackerOptions,
            IMemoryCache memoryCache)
        {
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _memoryCache        = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));

            _cacheTime = _timeTrackerOptions.NotificationsCacheMinutes;
        }
 /// <summary>
 /// Constructor
 /// </summary>
 public GraphAppUserService(
     IGraphAuthProvider authProvider,
     IUserContext userContext,
     ILogger <GraphAppUserService> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     IHostingEnvironment hostingEnvironment) : base(authProvider, userContext)
 {
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
 }
        public ReportHoursMemoryCache(
            ILogger <ReportHoursMemoryCache> logger,
            IOptions <TimeTrackerOptions> timeTrackerOptions,
            IMemoryCache memoryCache)
        {
            _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
            _timeTrackerOptions = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _memoryCache        = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache));

            _cacheTime = _timeTrackerOptions.WorkHoursCacheMinutes; // TODO: Add setting for this one in timetrackeroptions
        }
        public AutoSubmitWorkHoursTask(
            TimeTrackerOptions timeTrackerOptions,
            GraphAppUserService graphUserService,
            GraphAppSharePointService graphSharePointService)
        {
            _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
            _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
            _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));

            _schedule = _timeTrackerOptions.CutoffDayEmployee;
        }
 public TimerHoursRepository(
     ILogger <TimerHoursRepository> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     GraphAppSharePointService graphSharePointService,
     IUserContext userContext
     )
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _userContext            = userContext ?? throw new ArgumentNullException(nameof(userContext));
 }
 public TeamHoursController(
     ILogger <TeamHoursController> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <UserProfile> userProfileRepository,
     IViewModelService <TeamHoursViewModel> teamHoursService,
     IDataService dataServiceClient)
 {
     _logger                = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions    = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userProfileRepository = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _teamHoursService      = teamHoursService ?? throw new ArgumentNullException(nameof(teamHoursService));
     _dataServiceClient     = dataServiceClient ?? throw new ArgumentNullException(nameof(dataServiceClient));
 }
 public TeamHoursService(
     ILogger <TeamHoursService> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <UserProfile> userProfileRepository,
     IRepository <TeamHours> teamHoursRepository,
     LocService sharedLocalizer)
 {
     _logger                = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions    = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userProfileRepository = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _teamHoursRepository   = teamHoursRepository ?? throw new ArgumentNullException(nameof(teamHoursRepository));
     _sharedLocalizer       = sharedLocalizer;
 }
Beispiel #21
0
 public ReportHoursRepository(
     ILogger <ReportHoursRepository> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     ICacheService <ListCollectionPage <ReportHours> > reportHoursCache)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _reportHoursCache       = reportHoursCache ?? throw new ArgumentNullException(nameof(reportHoursCache));
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public WorkHoursWorkflowService(
     TimeTrackerOptions timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     WorkflowServiceHelper workflowServiceHelper,
     string objectIdentifier)
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _workflowServiceHelper  = workflowServiceHelper ?? throw new ArgumentNullException(nameof(workflowServiceHelper));
     _objectIdentifier       = objectIdentifier;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public WorkflowServiceHelper(
     ILogger <WorkflowServiceHelper> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     IRepository <Notifications> notificationsRepository,
     IRepository <UserProfile> userProfileRepository)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _userProfileRepository  = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
 }
Beispiel #24
0
 public UserProfileRepository(
     TimeTrackerOptions timeTrackerOptions,
     IUserContext userContext,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     string objectIdentifier
     )
 {
     _timeTrackerOptions     = timeTrackerOptions ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userContext            = userContext ?? throw new ArgumentNullException(nameof(userContext));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _objectIdentifier       = objectIdentifier;
 }
Beispiel #25
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logger">The logging provider to use</param>
 public AnalyticsController(
     ILogger <MonthlyReportHoursController> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <UserProfile> userProfileRepository,
     IAnalyticsServiceDashBoard <AnalyticsViewModel> analyticsservice,
     IDataService dataServiceClient
     )
 {
     _logger                = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions    = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userProfileRepository = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _analyticsService      = analyticsservice ?? throw new ArgumentNullException(nameof(analyticsservice));
     _dataServiceClient     = dataServiceClient ?? throw new ArgumentNullException(nameof(dataServiceClient));
 }
Beispiel #26
0
 public UserProfileRepository(
     ILogger <UserProfileRepository> logger,
     IOptions <TimeTrackerOptions> timeTrackerOptions,
     IUserContext userContext,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     ICacheService <UserProfile> memoryCacheService)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userContext            = userContext ?? throw new ArgumentNullException(nameof(userContext));
     _graphUserService       = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _memoryCacheService     = memoryCacheService ?? throw new ArgumentNullException(nameof(memoryCacheService));
 }
Beispiel #27
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logger">The logging provider to use</param>
 /// <param name="timeTrackerOptions">The app settings provider</param>
 /// <param name="dataServiceClient">Data Service client</param>
 public HomeController(
     ILogger <HomeController> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <MiddleTier.Models.UserProfile> userProfileRepository,
     GraphAppSharePointService graphSharePointService,
     IDataService dataServiceClient,
     LocService sharedLocalizer, ICacheService <ListCollectionPage <WorkHours> > cacheService)
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _dataServiceClient      = dataServiceClient ?? throw new ArgumentNullException(nameof(dataServiceClient));
     _sharedLocalizer        = sharedLocalizer ?? throw new ArgumentNullException(nameof(logger));
     _userProfileRepository  = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _cacheService           = cacheService ?? throw new ArgumentNullException(nameof(cacheService));
 }
Beispiel #28
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="logger">The logging provider to use</param>
 public MonthlyReportHoursController(
     ILogger <MonthlyReportHoursController> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <UserProfile> userProfileRepository,
     IMonthlyReportHoursService <MyMonthlyHoursViewModel> reportHoursService,
     //    IMonthlyReportHoursService<MyMonthlyHoursViewModel> uxReportHoursService,
     IDataService dataServiceClient
     )
 {
     _logger                = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions    = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _userProfileRepository = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _reportHoursService    = reportHoursService ?? throw new ArgumentNullException(nameof(reportHoursService));
     // _uxReportHoursService = uxReportHoursService ?? throw new ArgumentNullException(nameof(uxReportHoursService));
     _dataServiceClient = dataServiceClient ?? throw new ArgumentNullException(nameof(dataServiceClient));
 }
 public AnalyticsService(
     ILogger <TimeTrackerDataService> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     IRepository <WorkHours> workHoursRepository,
     IRepository <Analytics> analyticsRepository,
     GraphAppSharePointService graphSharePointService,
     LocService sharedLocalizer
     )
 {
     _logger                 = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions     = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _workHoursRepository    = workHoursRepository ?? throw new ArgumentNullException(nameof(workHoursRepository));
     _analyticsRepository    = analyticsRepository ?? throw new ArgumentNullException(nameof(analyticsRepository));
     _graphSharePointService = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _sharedLocalizer        = sharedLocalizer ?? throw new ArgumentNullException(nameof(logger));
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public WorkHoursWorkflowService(
     ILogger <WorkHoursWorkflowService> logger,
     IOptionsSnapshot <TimeTrackerOptions> timeTrackerOptions,
     GraphAppUserService graphUserService,
     GraphAppSharePointService graphSharePointService,
     WorkflowServiceHelper workflowServiceHelper,
     IRepository <Notifications> notificationsRepository,
     IRepository <UserProfile> userProfileRepository,
     ICacheService <ListCollectionPage <WorkHours> > cacheService)
 {
     _logger                  = logger ?? throw new ArgumentNullException(nameof(logger));
     _timeTrackerOptions      = timeTrackerOptions.Value ?? throw new ArgumentNullException(nameof(timeTrackerOptions));
     _graphUserService        = graphUserService ?? throw new ArgumentNullException(nameof(graphUserService));
     _graphSharePointService  = graphSharePointService ?? throw new ArgumentNullException(nameof(graphSharePointService));
     _workflowServiceHelper   = workflowServiceHelper ?? throw new ArgumentNullException(nameof(workflowServiceHelper));
     _notificationsRepository = notificationsRepository ?? throw new ArgumentNullException(nameof(notificationsRepository));
     _userProfileRepository   = userProfileRepository ?? throw new ArgumentNullException(nameof(userProfileRepository));
     _cacheService            = cacheService ?? throw new ArgumentNullException(nameof(cacheService));
 }