Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SentNotificationsController"/> class.
        /// </summary>
        /// <param name="notificationDataRepository">Notification data repository service that deals with the table storage in azure.</param>
        /// <param name="sentNotificationDataRepository">Sent notification data repository.</param>
        /// <param name="teamDataRepository">Team data repository instance.</param>
        /// <param name="prepareToSendQueue">The service bus queue for preparing to send notifications.</param>
        /// <param name="dataQueue">The service bus queue for the data queue.</param>
        /// <param name="dataQueueMessageOptions">The options for the data queue messages.</param>
        /// <param name="groupsService">The groups service.</param>
        /// <param name="exportDataRepository">The Export data repository instance.</param>
        /// <param name="appCatalogService">App catalog service.</param>
        /// <param name="appSettingsService">App settings service.</param>
        /// <param name="userAppOptions">User app options.</param>
        /// <param name="loggerFactory">The logger factory.</param>
        public SentNotificationsController(
            INotificationDataRepository notificationDataRepository,
            ISentNotificationDataRepository sentNotificationDataRepository,
            ITeamDataRepository teamDataRepository,
            IPrepareToSendQueue prepareToSendQueue,
            IDataQueue dataQueue,
            IOptions <DataQueueMessageOptions> dataQueueMessageOptions,
            IGroupsService groupsService,
            IExportDataRepository exportDataRepository,
            IAppCatalogService appCatalogService,
            IAppSettingsService appSettingsService,
            IOptions <UserAppOptions> userAppOptions,
            ILoggerFactory loggerFactory)
        {
            if (dataQueueMessageOptions is null)
            {
                throw new ArgumentNullException(nameof(dataQueueMessageOptions));
            }

            this.notificationDataRepository     = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
            this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository));
            this.teamDataRepository             = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository));
            this.prepareToSendQueue             = prepareToSendQueue ?? throw new ArgumentNullException(nameof(prepareToSendQueue));
            this.dataQueue = dataQueue ?? throw new ArgumentNullException(nameof(dataQueue));
            this.forceCompleteMessageDelayInSeconds = dataQueueMessageOptions.Value.ForceCompleteMessageDelayInSeconds;
            this.groupsService        = groupsService ?? throw new ArgumentNullException(nameof(groupsService));
            this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
            this.appCatalogService    = appCatalogService ?? throw new ArgumentNullException(nameof(appCatalogService));
            this.appSettingsService   = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
            this.userAppOptions       = userAppOptions?.Value ?? throw new ArgumentNullException(nameof(userAppOptions));
            this.logger = loggerFactory?.CreateLogger <SentNotificationsController>() ?? throw new ArgumentNullException(nameof(loggerFactory));
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExportFunction"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">Notification data repository.</param>
 /// <param name="exportDataRepository">Export data repository.</param>
 /// <param name="localizer">Localization service.</param>
 public ExportFunction(
     INotificationDataRepository notificationDataRepository,
     IExportDataRepository exportDataRepository,
     IStringLocalizer <Strings> localizer)
 {
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.exportDataRepository       = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
     this.localizer = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CompanyCommunicatorCleanUpFunction"/> class.
 /// </summary>
 /// <param name="exportDataRepository">The export data repository.</param>
 /// <param name="blobContainerClient">The Azure Blob storage container client.</param>
 /// <param name="fileCardService">The service to manage the file card.</param>
 /// <param name="cleanUpFileOptions">The options to clean up file.</param>
 public CompanyCommunicatorCleanUpFunction(
     IExportDataRepository exportDataRepository,
     BlobContainerClient blobContainerClient,
     IFileCardService fileCardService,
     IOptions <CleanUpFileOptions> cleanUpFileOptions)
 {
     this.exportDataRepository     = exportDataRepository;
     this.fileCardService          = fileCardService;
     this.blobContainerClient      = blobContainerClient;
     this.cleanUpFileOlderThanDays = int.Parse(cleanUpFileOptions.Value.CleanUpFile);
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TeamsFileUpload"/> class.
 /// </summary>
 /// <param name="clientFactory">http client factory.</param>
 /// <param name="exportDataRepository">Export Data Repository.</param>
 /// <param name="blobContainerClient">azure blob container client.</param>
 /// <param name="localizer">Localization service.</param>
 public TeamsFileUpload(
     IHttpClientFactory clientFactory,
     IExportDataRepository exportDataRepository,
     BlobContainerClient blobContainerClient,
     IStringLocalizer <Strings> localizer)
 {
     this.clientFactory        = clientFactory ?? throw new ArgumentNullException(nameof(clientFactory));
     this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
     this.blobContainerClient  = blobContainerClient ?? throw new ArgumentNullException(nameof(blobContainerClient));
     this.localizer            = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
Esempio n. 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SentNotificationsController"/> class.
        /// </summary>
        /// <param name="channelDataRepository">Channel data repository service that deals with the table storage in azure.</param>
        /// <param name="notificationDataRepository">Notification data repository service that deals with the table storage in azure.</param>
        /// <param name="sentNotificationDataRepository">Sent notification data repository.</param>
        /// <param name="sentNotificationUpdateDataRepository">Sent update notification data repository.</param>
        /// <param name="sentNotificationDataRepstry">Sent notification data repository to Get Likes.</param>
        /// <param name="teamDataRepository">Team data repository instance.</param>
        /// <param name="distributionListDataRepository">DistributionList data repository instance.</param>
        /// <param name="prepareToSendQueue">The service bus queue for preparing to send notifications.</param>
        /// <param name="sendQueue">The service bus queue for the send queue.</param>
        /// <param name="dataQueue">The service bus queue for the data queue.</param>
        /// <param name="dataQueueMessageOptions">The options for the data queue messages.</param>
        /// <param name="groupsService">The groups service.</param>
        /// <param name="memberService">The meber info service.</param>
        /// <param name="reactionService">The reaction of message service.</param>
        /// <param name="exportDataRepository">The Export data repository instance.</param>
        /// <param name="appCatalogService">App catalog service.</param>
        /// <param name="appSettingsService">App settings service.</param>
        /// <param name="userAppOptions">User app options.</param>
        /// <param name="loggerFactory">The logger factory.</param>
        /// <param name="configuration">The Configuration.</param>
        /// <param name="botOptions">bot options.</param>
        public SentNotificationsController(
            IChannelDataRepository channelDataRepository,
            INotificationDataRepository notificationDataRepository,
            ISentUpdateandDeleteNotificationDataRepository sentNotificationDataRepository,
            ISentUpdateDataRepository sentNotificationUpdateDataRepository,
            ISentNotificationDataRepository sentNotificationDataRepstry,
            ITeamDataRepository teamDataRepository,
            IDistributionListDataRepository distributionListDataRepository,
            IPrepareToSendQueue prepareToSendQueue,
            ISendQueue sendQueue,
            IDataQueue dataQueue,
            IOptions <DataQueueMessageOptions> dataQueueMessageOptions,
            IGroupsService groupsService,
            IMessageReactionService reactionService,
            ITeamMembersService memberService,
            IExportDataRepository exportDataRepository,
            IAppCatalogService appCatalogService,
            IAppSettingsService appSettingsService,
            IOptions <UserAppOptions> userAppOptions,
            ILoggerFactory loggerFactory,
            IConfiguration configuration,
            IOptions <BotOptions> botOptions)
        {
            if (dataQueueMessageOptions is null)
            {
                throw new ArgumentNullException(nameof(dataQueueMessageOptions));
            }

            var options = botOptions ?? throw new ArgumentNullException(nameof(botOptions));

            this.channelDataRepository                = channelDataRepository ?? throw new ArgumentNullException(nameof(channelDataRepository));
            this.notificationDataRepository           = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
            this.sentNotificationDataRepository       = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository));
            this.sentNotificationUpdateDataRepository = sentNotificationUpdateDataRepository ?? throw new ArgumentException(nameof(sentNotificationUpdateDataRepository));
            this.sentNotificationDataRepstry          = sentNotificationDataRepstry ?? throw new ArgumentNullException(nameof(sentNotificationDataRepstry));
            this.teamDataRepository             = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository));
            this.distributionListDataRepository = distributionListDataRepository ?? throw new ArgumentNullException(nameof(distributionListDataRepository));
            this.prepareToSendQueue             = prepareToSendQueue ?? throw new ArgumentNullException(nameof(prepareToSendQueue));
            this.sendQueue = sendQueue ?? throw new ArgumentNullException(nameof(sendQueue));
            this.dataQueue = dataQueue ?? throw new ArgumentNullException(nameof(dataQueue));
            this.forceCompleteMessageDelayInSeconds = dataQueueMessageOptions.Value.ForceCompleteMessageDelayInSeconds;
            this.groupsService        = groupsService ?? throw new ArgumentNullException(nameof(groupsService));
            this.reactionService      = reactionService ?? throw new ArgumentNullException(nameof(reactionService));
            this.memberService        = memberService ?? throw new ArgumentNullException(nameof(memberService));
            this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
            this.appCatalogService    = appCatalogService ?? throw new ArgumentNullException(nameof(appCatalogService));
            this.appSettingsService   = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
            this.userAppOptions       = userAppOptions?.Value ?? throw new ArgumentNullException(nameof(userAppOptions));
            this.logger        = loggerFactory?.CreateLogger <SentNotificationsController>() ?? throw new ArgumentNullException(nameof(loggerFactory));
            this.account       = string.Empty;
            this.configuration = configuration;
        }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HandleExportFailureActivity"/> class.
 /// </summary>
 /// <param name="exportDataRepository">the export data respository.</param>
 /// <param name="storageClientFactory">the storage client factory.</param>
 /// <param name="botOptions">the bot options.</param>
 /// <param name="botAdapter">the users service.</param>
 /// <param name="userDataRepository">the user data repository.</param>
 /// <param name="localizer">Localization service.</param>
 public HandleExportFailureActivity(
     IExportDataRepository exportDataRepository,
     IStorageClientFactory storageClientFactory,
     IOptions <BotOptions> botOptions,
     ICCBotFrameworkHttpAdapter botAdapter,
     IUserDataRepository userDataRepository,
     IStringLocalizer <Strings> localizer)
 {
     this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
     this.storageClientFactory = storageClientFactory ?? throw new ArgumentNullException(nameof(storageClientFactory));
     this.botAdapter           = botAdapter ?? throw new ArgumentNullException(nameof(botAdapter));
     this.authorAppId          = botOptions?.Value?.AuthorAppId ?? throw new ArgumentNullException(nameof(botOptions));
     this.userDataRepository   = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository));
     this.localizer            = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExportFunction"/> class.
 /// </summary>
 /// <param name="notificationDataRepository">Notification data repository.</param>
 /// <param name="exportDataRepository">Export data repository.</param>
 /// <param name="localizer">Localization service.</param>
 public ExportFunction(
     INotificationDataRepository notificationDataRepository,
     IExportDataRepository exportDataRepository,
     IStringLocalizer <Strings> localizer,
     ITeamMembersService memberService,
     IUserDataRepository userDataRepository,
     ITeamDataRepository teamDataRepository
     )
 {
     this.notificationDataRepository = notificationDataRepository ?? throw new ArgumentNullException(nameof(notificationDataRepository));
     this.exportDataRepository       = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
     this.localizer          = localizer ?? throw new ArgumentNullException(nameof(localizer));
     this.memberService      = memberService ?? throw new ArgumentNullException(nameof(memberService));
     this.userDataRepository = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository));
     this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HandleExportFailureActivity"/> class.
 /// </summary>
 /// <param name="exportDataRepository">the export data respository.</param>
 /// <param name="repositoryOptions">the repository options.</param>
 /// <param name="botOptions">the bot options.</param>
 /// <param name="botAdapter">the users service.</param>
 /// <param name="userDataRepository">the user data repository.</param>
 /// <param name="localizer">Localization service.</param>
 public HandleExportFailureActivity(
     IExportDataRepository exportDataRepository,
     IOptions <RepositoryOptions> repositoryOptions,
     IOptions <BotOptions> botOptions,
     BotFrameworkHttpAdapter botAdapter,
     IUserDataRepository userDataRepository,
     IStringLocalizer <Strings> localizer)
 {
     this.exportDataRepository    = exportDataRepository;
     this.storageConnectionString = repositoryOptions.Value.StorageAccountConnectionString;
     this.blobContainerClient     = new BlobContainerClient(this.storageConnectionString, Common.Constants.BlobContainerName);
     this.botAdapter         = botAdapter;
     this.authorAppId        = botOptions.Value.AuthorAppId;
     this.userDataRepository = userDataRepository;
     this.localizer          = localizer ?? throw new ArgumentNullException(nameof(localizer));
 }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExportController"/> class.
 /// </summary>
 /// <param name="sentNotificationDataRepository">SentNotification data repository instance.</param>
 /// <param name="exportDataRepository">Export data repository instance.</param>
 /// <param name="userDataRepository">User data repository instance.</param>
 /// <param name="exportQueue">The service bus queue for the export queue.</param>
 /// <param name="memberService">Teams member service.</param>
 /// <param name="teamDataRepository">Team data reporsitory.</param>
 /// <param name="appSettingsService">App Settings service.</param>
 public ExportController(
     ISentNotificationDataRepository sentNotificationDataRepository,
     IExportDataRepository exportDataRepository,
     IUserDataRepository userDataRepository,
     IExportQueue exportQueue,
     ITeamMembersService memberService,
     ITeamDataRepository teamDataRepository,
     IAppSettingsService appSettingsService)
 {
     this.sentNotificationDataRepository = sentNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationDataRepository));
     this.exportDataRepository           = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
     this.userDataRepository             = userDataRepository ?? throw new ArgumentNullException(nameof(userDataRepository));
     this.exportQueue        = exportQueue ?? throw new ArgumentNullException(nameof(exportQueue));
     this.memberService      = memberService ?? throw new ArgumentNullException(nameof(memberService));
     this.teamDataRepository = teamDataRepository ?? throw new ArgumentNullException(nameof(teamDataRepository));
     this.appSettingsService = appSettingsService ?? throw new ArgumentNullException(nameof(appSettingsService));
 }
Esempio n. 10
0
 public ExportDataController(IExportDataRepository exportDataRepository)
 {
     this.exportDataRepository = exportDataRepository;
 }
Esempio n. 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateExportDataActivity"/> class.
 /// </summary>
 /// <param name="exportDataRepository">the export data respository.</param>
 public UpdateExportDataActivity(IExportDataRepository exportDataRepository)
 {
     this.exportDataRepository = exportDataRepository ?? throw new ArgumentNullException(nameof(exportDataRepository));
 }
Esempio n. 12
0
 public ExportDataAPIController(IExportDataRepository repository, ApplicationDbContext context)
 {
     _repository = repository;
     _context    = context;
 }