public ShiftChangeHandler(TeamOrchestratorOptions teamOptions, IScheduleConnectorService scheduleConnectorService, IRequestCacheService requestCacheService, ISecretsService secretsService, IStringLocalizer <ChangeRequestTrigger> stringLocalizer, IScheduleCacheService scheduleCacheService, ISystemTimeService systemTimeService)
     : base(scheduleConnectorService, requestCacheService, secretsService, stringLocalizer)
 {
     _teamOptions          = teamOptions ?? throw new ArgumentNullException(nameof(teamOptions));
     _scheduleCacheService = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService));
     _systemTimeService    = systemTimeService ?? throw new ArgumentNullException(nameof(systemTimeService));
 }
コード例 #2
0
 public ClearCacheActivity(FeatureOptions featureOptions, TeamOrchestratorOptions options, IScheduleCacheService scheduleCacheService, ITimeOffCacheService timeOffCacheService)
 {
     _featureOptions       = featureOptions ?? throw new ArgumentNullException(nameof(featureOptions));
     _options              = options ?? throw new ArgumentNullException(nameof(options));
     _scheduleCacheService = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService));
     _timeOffCacheService  = timeOffCacheService ?? throw new ArgumentNullException(nameof(timeOffCacheService));
 }
コード例 #3
0
 public ManagerAssignOpenShiftHandler(TeamOrchestratorOptions teamOptions, IScheduleConnectorService scheduleConnectorService, IRequestCacheService requestCacheService, ISecretsService secretsService, IStringLocalizer <Triggers.ChangeRequestTrigger> stringLocalizer, IScheduleCacheService scheduleCacheService, ICacheService cacheService, IWfmActionService wfmActionService)
     : base(scheduleConnectorService, requestCacheService, secretsService, stringLocalizer)
 {
     _teamOptions          = teamOptions ?? throw new ArgumentNullException(nameof(teamOptions));
     _scheduleCacheService = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService));
     _cacheService         = cacheService ?? throw new ArgumentNullException(nameof(cacheService));
     _wfmActionService     = wfmActionService ?? throw new ArgumentNullException(nameof(wfmActionService));
 }
コード例 #4
0
 public TeamHealthTrigger(ConnectorOptions options, ISecretsService secretsService, IScheduleSourceService scheduleSourceService, IScheduleConnectorService scheduleConnectorService, IScheduleDestinationService scheduleDestinationService, IScheduleCacheService scheduleCacheService)
 {
     _options                    = options ?? throw new ArgumentNullException(nameof(options));
     _secretsService             = secretsService ?? throw new ArgumentNullException(nameof(secretsService));
     _scheduleSourceService      = scheduleSourceService ?? throw new ArgumentNullException(nameof(scheduleSourceService));
     _scheduleConnectorService   = scheduleConnectorService ?? throw new ArgumentNullException(nameof(scheduleConnectorService));
     _scheduleDestinationService = scheduleDestinationService ?? throw new ArgumentNullException(nameof(scheduleDestinationService));
     _scheduleCacheService       = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService));
 }
コード例 #5
0
 protected SwapRequestHandler(TeamOrchestratorOptions teamOptions, FeatureOptions featureOptions, IScheduleConnectorService scheduleConnectorService, IScheduleCacheService scheduleCacheService, IRequestCacheService requestCacheService, ISecretsService secretsService, IStringLocalizer <ChangeRequestTrigger> stringLocalizer, ICacheService cacheService, IWfmActionService wfmActionService)
     : base(scheduleConnectorService, requestCacheService, secretsService, stringLocalizer)
 {
     _teamOptions          = teamOptions ?? throw new ArgumentNullException(nameof(teamOptions));
     _featureOptions       = featureOptions ?? throw new ArgumentNullException(nameof(featureOptions));
     _scheduleCacheService = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService));
     _cacheService         = cacheService ?? throw new ArgumentNullException(nameof(cacheService));
     _wfmActionService     = wfmActionService ?? throw new ArgumentNullException(nameof(wfmActionService));
 }
コード例 #6
0
 public WeekActivity(WeekActivityOptions options, IScheduleSourceService scheduleSourceService, IScheduleCacheService scheduleCacheService,
                     IScheduleDestinationService scheduleDestinationService, IScheduleDeltaService scheduleDeltaService, ISecretsService secretsService)
 {
     _options = options ?? throw new ArgumentNullException(nameof(options));
     _scheduleSourceService      = scheduleSourceService ?? throw new ArgumentNullException(nameof(scheduleSourceService));
     _scheduleCacheService       = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService));
     _scheduleDestinationService = scheduleDestinationService ?? throw new ArgumentNullException(nameof(scheduleDestinationService));
     _scheduleDeltaService       = scheduleDeltaService ?? throw new ArgumentNullException(nameof(scheduleDeltaService));
     _secretsService             = secretsService ?? throw new ArgumentNullException(nameof(secretsService));
 }
コード例 #7
0
 public TeamHealthTrigger(FeatureOptions featureOptions, ConnectorOptions options, IWfmDataService wfmDataService, IScheduleConnectorService scheduleConnectorService, ITeamsService teamsService, IScheduleCacheService scheduleCacheService, ICacheService cacheService)
 {
     _featureOptions           = featureOptions ?? throw new ArgumentNullException(nameof(featureOptions));
     _options                  = options ?? throw new ArgumentNullException(nameof(options));
     _wfmDataService           = wfmDataService ?? throw new ArgumentNullException(nameof(wfmDataService));
     _scheduleConnectorService = scheduleConnectorService ?? throw new ArgumentNullException(nameof(scheduleConnectorService));
     _teamsService             = teamsService ?? throw new ArgumentNullException(nameof(teamsService));
     _scheduleCacheService     = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService));
     _cacheService             = cacheService ?? throw new ArgumentNullException(nameof(cacheService));
 }
コード例 #8
0
 public ShiftsWeekActivity(WeekActivityOptions options, IWfmDataService wfmDataService, ITeamsService teamsService, IDeltaService <ShiftModel> deltaService, ICacheService cacheService, IScheduleCacheService scheduleCacheService)
     : base(options, wfmDataService, teamsService, deltaService, cacheService, scheduleCacheService)
 {
 }
コード例 #9
0
 public CancelOpenShiftRequestHandler(TeamOrchestratorOptions teamOptions, FeatureOptions featureOptions, IScheduleConnectorService scheduleConnectorService, IScheduleCacheService scheduleCacheService, IRequestCacheService requestCacheService, ISecretsService secretsService, IStringLocalizer <ChangeRequestTrigger> stringLocalizer, ICacheService cacheService, IWfmActionService wfmActionService)
     : base(teamOptions, featureOptions, scheduleConnectorService, scheduleCacheService, requestCacheService, secretsService, stringLocalizer, cacheService, wfmActionService)
 {
 }
 public ClearCacheActivity(TeamOrchestratorOptions options, IScheduleCacheService scheduleCacheService, IScheduleDestinationService scheduleDestinationService)
 {
     _options = options ?? throw new ArgumentNullException(nameof(options));
     _scheduleCacheService       = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService));
     _scheduleDestinationService = scheduleDestinationService ?? throw new ArgumentNullException(nameof(scheduleDestinationService));
 }
コード例 #11
0
 protected ShiftActivityBase(WeekActivityOptions options, IWfmDataService wfmDataService, ITeamsService teamsService, IDeltaService <ShiftModel> deltaService, ICacheService cacheService, IScheduleCacheService scheduleCacheService)
     : base(options, wfmDataService, teamsService, deltaService, cacheService)
 {
     _scheduleCacheService = scheduleCacheService ?? throw new ArgumentNullException(nameof(scheduleCacheService));
 }
        /// <summary>
        /// Loads and returns all the cached schedules for the team between and including the past
        /// and future weeks.
        /// </summary>
        /// <param name="teamId">The ID of the team to return the cached schedules for.</param>
        /// <param name="pastWeeks">The number of past weeks to return.</param>
        /// <param name="futureWeeks">The number of future weeks to return.</param>
        /// <param name="startDayOfWeek">The start day of the week for the team.</param>
        /// <param name="scheduleCacheService">The schedule cache service to use to load the schedules.</param>
        /// <param name="timeService">The time service to use to get the current times.</param>
        /// <returns>The array of cached schedules.</returns>
        internal static async Task <CacheModel <ShiftModel>[]> LoadSchedulesAsync(string teamId, int pastWeeks, int futureWeeks, DayOfWeek startDayOfWeek, IScheduleCacheService scheduleCacheService, ISystemTimeService timeService)
        {
            var loadScheduleTasks = timeService.UtcNow
                                    .Range(pastWeeks, futureWeeks, startDayOfWeek)
                                    .Select(w => scheduleCacheService.LoadScheduleAsync(teamId, w));

            return(await Task.WhenAll(loadScheduleTasks).ConfigureAwait(false));
        }
        /// <summary>
        /// Finds the shift with the specified teams shift ID by searching all the cached shifts in
        /// the specified range of weeks.
        /// </summary>
        /// <param name="shiftId">The teams ID of the shift to search for.</param>
        /// <param name="teamId">The ID of the team containing the shift.</param>
        /// <param name="pastWeeks">The number of past weeks to search.</param>
        /// <param name="futureWeeks">The number of future weeks to search.</param>
        /// <param name="startDayOfWeek">The start day of the week for the team.</param>
        /// <param name="scheduleCacheService">The schedule cache service to use to load the schedules.</param>
        /// <param name="timeService">The time service to use to get the current times.</param>
        /// <returns></returns>
        internal static async Task <ShiftModel> FindShiftByTeamsShiftIdAsync(string shiftId, string teamId, int pastWeeks, int futureWeeks, DayOfWeek startDayOfWeek, IScheduleCacheService scheduleCacheService, ISystemTimeService timeService)
        {
            var cacheModels = await LoadSchedulesAsync(teamId, pastWeeks, futureWeeks, startDayOfWeek, scheduleCacheService, timeService).ConfigureAwait(false);

            return(FindShiftByTeamsShiftId(cacheModels, shiftId));
        }