/// <summary> /// Initializes a new instance of the <see cref="NotificationStatusHandler"/> class. /// </summary> /// <param name="fulfillApiClient">The fulfill API client.</param> /// <param name="planRepository">The plan repository.</param> /// <param name="applicationConfigRepository">The application configuration repository.</param> /// <param name="emailTemplateRepository">The email template repository.</param> /// <param name="planEventsMappingRepository">The plan events mapping repository.</param> /// <param name="offerAttributesRepository">The offer attributes repository.</param> /// <param name="eventsRepository">The events repository.</param> /// <param name="subscriptionRepository">The subscription repository.</param> /// <param name="usersRepository">The users repository.</param> /// <param name="offersRepository">The offers repository.</param> /// <param name="subscriptionTemplateParametersRepository">The subscription template parameters repository.</param> /// <param name="emailService">The email service.</param> /// <param name="emailHelper">The email helper.</param> /// <param name="logger">The logger.</param> public NotificationStatusHandler( IFulfillmentApiClient fulfillApiClient, IPlansRepository planRepository, IApplicationConfigRepository applicationConfigRepository, IEmailTemplateRepository emailTemplateRepository, IPlanEventsMappingRepository planEventsMappingRepository, IOfferAttributesRepository offerAttributesRepository, IEventsRepository eventsRepository, ISubscriptionsRepository subscriptionRepository, IUsersRepository usersRepository, IOffersRepository offersRepository, IEmailService emailService, ILogger <NotificationStatusHandler> logger) : base(subscriptionRepository, planRepository, usersRepository) { this.fulfillmentApiClient = fulfillApiClient; this.applicationConfigRepository = applicationConfigRepository; this.planEventsMappingRepository = planEventsMappingRepository; this.offerAttributesRepository = offerAttributesRepository; this.eventsRepository = eventsRepository; this.emailTemplateRepository = emailTemplateRepository; this.subscriptionRepository = subscriptionRepository; this.planRepository = planRepository; this.subscriptionService = new SubscriptionService(this.subscriptionRepository, this.planRepository); this.offersRepository = offersRepository; this.emailService = emailService; this.emailHelper = new EmailHelper(applicationConfigRepository, subscriptionRepository, emailTemplateRepository, planEventsMappingRepository, eventsRepository); this.logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="WebHookHandler" /> class. /// </summary> /// <param name="applicationLogRepository">The application log repository.</param> /// <param name="subscriptionsLogRepository">The subscriptions log repository.</param> /// <param name="subscriptionsRepository">The subscriptions repository.</param> /// <param name="planRepository">The plan repository.</param> /// <param name="offersAttributeRepository">The offers attribute repository.</param> /// <param name="offersRepository">The offers repository.</param> /// <param name="fulfillApiClient">The fulfill API client.</param> /// <param name="usersRepository">The users repository.</param> /// <param name="loggerFactory">The logger factory.</param> /// <param name="emailService">The email service.</param> /// <param name="eventsRepository">The events repository.</param> /// <param name="applicationConfigRepository">The application configuration repository.</param> /// <param name="emailTemplateRepository">The email template repository.</param> /// <param name="planEventsMappingRepository">The plan events mapping repository.</param> public WebHookHandler(IApplicationLogRepository applicationLogRepository, ISubscriptionLogRepository subscriptionsLogRepository, ISubscriptionsRepository subscriptionsRepository, IPlansRepository planRepository, IOfferAttributesRepository offersAttributeRepository, IOffersRepository offersRepository, IFulfillmentApiClient fulfillApiClient, IUsersRepository usersRepository, ILoggerFactory loggerFactory, IEmailService emailService, IEventsRepository eventsRepository, IApplicationConfigRepository applicationConfigRepository, IEmailTemplateRepository emailTemplateRepository, IPlanEventsMappingRepository planEventsMappingRepository) { this.applicationLogRepository = applicationLogRepository; this.subscriptionsRepository = subscriptionsRepository; this.planRepository = planRepository; this.subscriptionsLogRepository = subscriptionsLogRepository; this.applicationLogService = new ApplicationLogService(this.applicationLogRepository); this.subscriptionService = new SubscriptionService(this.subscriptionsRepository, this.planRepository); this.emailService = emailService; this.loggerFactory = loggerFactory; this.usersRepository = usersRepository; this.eventsRepository = eventsRepository; this.offersAttributeRepository = offersAttributeRepository; this.fulfillApiClient = fulfillApiClient; this.applicationConfigRepository = applicationConfigRepository; this.emailTemplateRepository = emailTemplateRepository; this.planEventsMappingRepository = planEventsMappingRepository; this.offersRepository = offersRepository; this.notificationStatusHandlers = new NotificationStatusHandler( fulfillApiClient, planRepository, applicationConfigRepository, emailTemplateRepository, planEventsMappingRepository, offersAttributeRepository, eventsRepository, subscriptionsRepository, usersRepository, offersRepository, emailService, this.loggerFactory.CreateLogger <NotificationStatusHandler>()); }
/// <summary> /// Initializes a new instance of the <see cref="OffersController"/> class. /// </summary> /// <param name="offersRepository">The offers repository.</param> /// <param name="applicationConfigRepository">The application configuration repository.</param> /// <param name="usersRepository">The users repository.</param> /// <param name="valueTypesRepository">The value types repository.</param> /// <param name="offersAttributeRepository">The offers attribute repository.</param> /// <param name="logger">The logger.</param> public OffersController(IOffersRepository offersRepository, IApplicationConfigRepository applicationConfigRepository, IUsersRepository usersRepository, IValueTypesRepository valueTypesRepository, IOfferAttributesRepository offersAttributeRepository, ILogger <OffersController> logger) { this.offersRepository = offersRepository; this.applicationConfigRepository = applicationConfigRepository; this.usersRepository = usersRepository; this.valueTypesRepository = valueTypesRepository; this.offersService = new OfferServices(this.offersRepository); this.offersAttributeRepository = offersAttributeRepository; this.logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="PlansController" /> class. /// </summary> /// <param name="subscriptionRepository">The subscription repository.</param> /// <param name="usersRepository">The users repository.</param> /// <param name="applicationConfigRepository">The application configuration repository.</param> /// <param name="plansRepository">The plans repository.</param> /// <param name="offerAttributeRepository">The offer attribute repository.</param> /// <param name="offerRepository">The offer repository.</param> /// <param name="logger">The logger.</param> public PlansController(ISubscriptionsRepository subscriptionRepository, IUsersRepository usersRepository, IApplicationConfigRepository applicationConfigRepository, IPlansRepository plansRepository, IOfferAttributesRepository offerAttributeRepository, IOffersRepository offerRepository, ILogger <OffersController> logger) { this.subscriptionRepository = subscriptionRepository; this.usersRepository = usersRepository; this.applicationConfigRepository = applicationConfigRepository; this.plansRepository = plansRepository; this.offerAttributeRepository = offerAttributeRepository; this.offerRepository = offerRepository; this.logger = logger; this.plansService = new PlanService(this.plansRepository, this.offerAttributeRepository, this.offerRepository); }
/// <summary> /// Initializes a new instance of the <see cref="HomeController" /> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="apiClient">The API Client<see cref="IFulfilmentApiClient" />.</param> /// <param name="subscriptionRepo">The subscription repository.</param> /// <param name="planRepository">The plan repository.</param> /// <param name="userRepository">The user repository.</param> /// <param name="applicationLogRepository">The application log repository.</param> /// <param name="subscriptionLogsRepo">The subscription logs repository.</param> /// <param name="applicationConfigRepository">The application configuration repository.</param> /// <param name="emailTemplateRepository">The email template repository.</param> /// <param name="offersRepository">The offers repository.</param> /// <param name="planEventsMappingRepository">The plan events mapping repository.</param> /// <param name="offerAttributesRepository">The offer attributes repository.</param> /// <param name="eventsRepository">The events repository.</param> /// <param name="cloudConfigs">The cloud configs.</param> public HomeController(ILogger <HomeController> logger, IFulfillmentApiClient apiClient, ISubscriptionsRepository subscriptionRepo, IPlansRepository planRepository, IUsersRepository userRepository, IApplicationLogRepository applicationLogRepository, ISubscriptionLogRepository subscriptionLogsRepo, IApplicationConfigRepository applicationConfigRepository, IEmailTemplateRepository emailTemplateRepository, IOffersRepository offersRepository, IPlanEventsMappingRepository planEventsMappingRepository, IOfferAttributesRepository offerAttributesRepository, IEventsRepository eventsRepository, CloudStorageConfigs cloudConfigs) { this.apiClient = apiClient; this.subscriptionRepository = subscriptionRepo; this.subscriptionLogRepository = subscriptionLogsRepo; this.applicationLogRepository = applicationLogRepository; this.planRepository = planRepository; this.userRepository = userRepository; this.userService = new UserService(this.userRepository); this.subscriptionService = new SubscriptionService(this.subscriptionRepository, this.planRepository); this.applicationLogService = new ApplicationLogService(this.applicationLogRepository); this.applicationConfigRepository = applicationConfigRepository; this.emailTemplateRepository = emailTemplateRepository; this.planEventsMappingRepository = planEventsMappingRepository; this.offerAttributesRepository = offerAttributesRepository; this.logger = logger; this.offersRepository = offersRepository; this.planService = new PlanService(this.planRepository, this.offerAttributesRepository, this.offersRepository); this.eventsRepository = eventsRepository; this.cloudConfigs = cloudConfigs; this.azureWebJobsStorage = cloudConfigs.AzureWebJobsStorage; }
/// <summary> /// Initializes a new instance of the <see cref="PlanService"/> class. /// </summary> /// <param name="plansRepository">The plans repository.</param> /// <param name="offerAttributesRepository">The offer attributes repository.</param> /// <param name="offerRepository">The offer repository.</param> public PlanService(IPlansRepository plansRepository, IOfferAttributesRepository offerAttributesRepository, IOffersRepository offerRepository) { this.plansRepository = plansRepository; this.offerAttributesRepository = offerAttributesRepository; this.offerRepository = offerRepository; }
/// <summary> /// Initializes a new instance of the <see cref="HomeController" /> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="apiClient">The API Client<see cref="IFulfilmentApiClient" />.</param> /// <param name="subscriptionRepo">The subscription repository.</param> /// <param name="planRepository">The plan repository.</param> /// <param name="userRepository">The user repository.</param> /// <param name="applicationLogRepository">The application log repository.</param> /// <param name="subscriptionLogsRepo">The subscription logs repository.</param> /// <param name="applicationConfigRepository">The application configuration repository.</param> /// <param name="emailTemplateRepository">The email template repository.</param> /// <param name="offersRepository">The offers repository.</param> /// <param name="planEventsMappingRepository">The plan events mapping repository.</param> /// <param name="offerAttributesRepository">The offer attributes repository.</param> /// <param name="eventsRepository">The events repository.</param> /// <param name="cloudConfigs">The cloud configs.</param> /// <param name="loggerFactory">The logger factory.</param> /// <param name="emailService">The email service.</param> public HomeController(ILogger <HomeController> logger, IFulfillmentApiClient apiClient, ISubscriptionsRepository subscriptionRepo, IPlansRepository planRepository, IUsersRepository userRepository, IApplicationLogRepository applicationLogRepository, ISubscriptionLogRepository subscriptionLogsRepo, IApplicationConfigRepository applicationConfigRepository, IEmailTemplateRepository emailTemplateRepository, IOffersRepository offersRepository, IPlanEventsMappingRepository planEventsMappingRepository, IOfferAttributesRepository offerAttributesRepository, IEventsRepository eventsRepository, ILoggerFactory loggerFactory, IEmailService emailService) { this.apiClient = apiClient; this.subscriptionRepository = subscriptionRepo; this.subscriptionLogRepository = subscriptionLogsRepo; this.applicationLogRepository = applicationLogRepository; this.planRepository = planRepository; this.userRepository = userRepository; this.userService = new UserService(this.userRepository); this.subscriptionService = new SubscriptionService(this.subscriptionRepository, this.planRepository); this.applicationLogService = new ApplicationLogService(this.applicationLogRepository); this.applicationConfigRepository = applicationConfigRepository; this.emailTemplateRepository = emailTemplateRepository; this.planEventsMappingRepository = planEventsMappingRepository; this.offerAttributesRepository = offerAttributesRepository; this.logger = logger; this.offersRepository = offersRepository; this.planService = new PlanService(this.planRepository, this.offerAttributesRepository, this.offersRepository); this.eventsRepository = eventsRepository; this.emailService = emailService; this.loggerFactory = loggerFactory; this.pendingActivationStatusHandlers = new PendingActivationStatusHandler( apiClient, subscriptionRepo, subscriptionLogsRepo, planRepository, userRepository, loggerFactory.CreateLogger <PendingActivationStatusHandler>()); this.pendingFulfillmentStatusHandlers = new PendingFulfillmentStatusHandler( apiClient, applicationConfigRepository, subscriptionRepo, subscriptionLogsRepo, planRepository, userRepository, this.loggerFactory.CreateLogger <PendingFulfillmentStatusHandler>()); this.notificationStatusHandlers = new NotificationStatusHandler( apiClient, planRepository, applicationConfigRepository, emailTemplateRepository, planEventsMappingRepository, offerAttributesRepository, eventsRepository, subscriptionRepo, userRepository, offersRepository, emailService, this.loggerFactory.CreateLogger <NotificationStatusHandler>()); this.unsubscribeStatusHandlers = new UnsubscribeStatusHandler( apiClient, subscriptionRepo, subscriptionLogsRepo, planRepository, userRepository, this.loggerFactory.CreateLogger <UnsubscribeStatusHandler>()); }
/// <summary> /// Initializes a new instance of the <see cref="HomeController" /> class. /// </summary> /// <param name="usersRepository">The users repository.</param> /// <param name="billingApiService">The billing API service.</param> /// <param name="logger">The logger.</param> /// <param name="subscriptionRepo">The subscription repo.</param> /// <param name="planRepository">The plan repository.</param> /// <param name="subscriptionUsageLogsRepository">The subscription usage logs repository.</param> /// <param name="dimensionsRepository">The dimensions repository.</param> /// <param name="subscriptionLogsRepo">The subscription logs repo.</param> /// <param name="applicationConfigRepository">The application configuration repository.</param> /// <param name="userRepository">The user repository.</param> /// <param name="fulfillApiService">The fulfill API client.</param> /// <param name="applicationLogRepository">The application log repository.</param> /// <param name="emailTemplateRepository">The email template repository.</param> /// <param name="planEventsMappingRepository">The plan events mapping repository.</param> /// <param name="eventsRepository">The events repository.</param> /// <param name="options">The options.</param> /// <param name="cloudConfigs">The cloud configs.</param> /// <param name="loggerFactory">The logger factory.</param> /// <param name="emailService">The email service.</param> /// <param name="offersRepository">The offers repository.</param> /// <param name="offersAttributeRepository">The offers attribute repository.</param> public HomeController( IUsersRepository usersRepository, IMeteredBillingApiService billingApiService, ILogger <HomeController> logger, ISubscriptionsRepository subscriptionRepo, IPlansRepository planRepository, ISubscriptionUsageLogsRepository subscriptionUsageLogsRepository, IMeteredDimensionsRepository dimensionsRepository, ISubscriptionLogRepository subscriptionLogsRepo, IApplicationConfigRepository applicationConfigRepository, IUsersRepository userRepository, IFulfillmentApiService fulfillApiService, IApplicationLogRepository applicationLogRepository, IEmailTemplateRepository emailTemplateRepository, IPlanEventsMappingRepository planEventsMappingRepository, IEventsRepository eventsRepository, IOptions <SaaSApiClientConfiguration> options, ILoggerFactory loggerFactory, IEmailService emailService, IOffersRepository offersRepository, IOfferAttributesRepository offersAttributeRepository) { this.billingApiService = billingApiService; this.subscriptionRepo = subscriptionRepo; this.subscriptionLogRepository = subscriptionLogsRepo; this.planRepository = planRepository; this.subscriptionUsageLogsRepository = subscriptionUsageLogsRepository; this.dimensionsRepository = dimensionsRepository; this.logger = logger; this.applicationConfigRepository = applicationConfigRepository; this.applicationConfigService = new ApplicationConfigService(this.applicationConfigRepository); this.userRepository = userRepository; this.userService = new UserService(userRepository); this.fulfillApiService = fulfillApiService; this.applicationLogRepository = applicationLogRepository; this.applicationLogService = new ApplicationLogService(this.applicationLogRepository); this.subscriptionRepository = this.subscriptionRepo; this.subscriptionService = new SubscriptionService(this.subscriptionRepository, this.planRepository); this.emailTemplateRepository = emailTemplateRepository; this.planEventsMappingRepository = planEventsMappingRepository; this.eventsRepository = eventsRepository; this.emailService = emailService; this.offersRepository = offersRepository; this.offersAttributeRepository = offersAttributeRepository; this.loggerFactory = loggerFactory; this.pendingActivationStatusHandlers = new PendingActivationStatusHandler( fulfillApiService, subscriptionRepo, subscriptionLogsRepo, planRepository, userRepository, loggerFactory.CreateLogger <PendingActivationStatusHandler>()); this.pendingFulfillmentStatusHandlers = new PendingFulfillmentStatusHandler( fulfillApiService, applicationConfigRepository, subscriptionRepo, subscriptionLogsRepo, planRepository, userRepository, this.loggerFactory.CreateLogger <PendingFulfillmentStatusHandler>()); this.notificationStatusHandlers = new NotificationStatusHandler( fulfillApiService, planRepository, applicationConfigRepository, emailTemplateRepository, planEventsMappingRepository, offersAttributeRepository, eventsRepository, subscriptionRepo, userRepository, offersRepository, emailService, this.loggerFactory.CreateLogger <NotificationStatusHandler>()); this.unsubscribeStatusHandlers = new UnsubscribeStatusHandler( fulfillApiService, subscriptionRepo, subscriptionLogsRepo, planRepository, userRepository, this.loggerFactory.CreateLogger <UnsubscribeStatusHandler>()); }
/// <summary> /// Initializes a new instance of the <see cref="Functions"/> class. /// </summary> /// <param name="fulfillmentApiClient">The fulfillment API client.</param> /// <param name="subscriptionRepository">The subscription repository.</param> /// <param name="applicationConfigRepository">The application configuration repository.</param> /// <param name="subscriptionLogRepository">The subscription log repository.</param> /// <param name="emailTemplaterepository">The email templaterepository.</param> /// <param name="planEventsMappingRepository">The plan events mapping repository.</param> /// <param name="offerAttributesRepository">The offer attributes repository.</param> /// <param name="eventsRepository">The events repository.</param> /// <param name="azureKeyVaultClient">The azure key vault client.</param> /// <param name="planRepository">The plan repository.</param> /// <param name="offersRepository">The offers repository.</param> /// <param name="usersRepository">The users repository.</param> /// <param name="armTemplateRepository">The arm template repository.</param> /// <param name="azureBlobFileClient">The azure BLOB file client.</param> /// <param name="subscriptionTemplateParametersRepository">The subscription template parameters repository.</param> /// <param name="keyVaultConfig">The key vault configuration.</param> /// <param name="emailService">The email service.</param> /// <param name="emailHelper">The email helper.</param> /// <param name="loggerFactory">The logger factory.</param> public Functions( IFulfillmentApiClient fulfillmentApiClient, ISubscriptionsRepository subscriptionRepository, IApplicationConfigRepository applicationConfigRepository, ISubscriptionLogRepository subscriptionLogRepository, IEmailTemplateRepository emailTemplaterepository, IPlanEventsMappingRepository planEventsMappingRepository, IOfferAttributesRepository offerAttributesRepository, IEventsRepository eventsRepository, IPlansRepository planRepository, IOffersRepository offersRepository, IUsersRepository usersRepository, IEmailService emailService, EmailHelper emailHelper, ILoggerFactory loggerFactory) { this.fulfillmentApiClient = fulfillmentApiClient; this.subscriptionRepository = subscriptionRepository; this.applicationConfigrepository = applicationConfigRepository; this.emailTemplaterepository = emailTemplaterepository; this.planEventsMappingRepository = planEventsMappingRepository; this.offerAttributesRepository = offerAttributesRepository; this.eventsRepository = eventsRepository; this.subscriptionLogRepository = subscriptionLogRepository; this.planRepository = planRepository; this.offersRepository = offersRepository; this.usersRepository = usersRepository; this.emialService = emailService; this.emailHelper = emailHelper; this.loggerFactory = loggerFactory; this.activateStatusHandlers = new List <ISubscriptionStatusHandler>(); this.deactivateStatusHandlers = new List <ISubscriptionStatusHandler>(); this.activateStatusHandlers.Add(new PendingActivationStatusHandler( fulfillmentApiClient, subscriptionRepository, subscriptionLogRepository, planRepository, usersRepository, this.loggerFactory.CreateLogger <PendingActivationStatusHandler>())); this.activateStatusHandlers.Add(new PendingFulfillmentStatusHandler( fulfillmentApiClient, this.applicationConfigrepository, subscriptionRepository, subscriptionLogRepository, planRepository, usersRepository, this.loggerFactory.CreateLogger <PendingFulfillmentStatusHandler>())); this.activateStatusHandlers.Add(new NotificationStatusHandler( fulfillmentApiClient, planRepository, this.applicationConfigrepository, emailTemplaterepository, planEventsMappingRepository, offerAttributesRepository, eventsRepository, subscriptionRepository, usersRepository, offersRepository, emailService, this.loggerFactory.CreateLogger <NotificationStatusHandler>())); this.deactivateStatusHandlers.Add(new UnsubscribeStatusHandler( fulfillmentApiClient, subscriptionRepository, subscriptionLogRepository, planRepository, usersRepository, this.loggerFactory.CreateLogger <UnsubscribeStatusHandler>())); this.deactivateStatusHandlers.Add(new NotificationStatusHandler( fulfillmentApiClient, planRepository, this.applicationConfigrepository, emailTemplaterepository, planEventsMappingRepository, offerAttributesRepository, eventsRepository, subscriptionRepository, usersRepository, offersRepository, emailService, this.loggerFactory.CreateLogger <NotificationStatusHandler>())); }