public CampaignLogicFactory(
            ISubscriberTrackingService<ApplicationSummary> applicationSubscriberTrackingService,
            IDataGatherFactory<ApplicationSummary> applicationGatherFactory,
            IDataGatherFactory<LandlordSummary> landlordGatherFactory,
            ISubscriberTrackingService<LandlordSummary> landlordSubscriberTrackingService,
            IApplicationService applicationService,
            ILetMeServiceUrlSettings letMeServiceUrlSettings,
            ISubscriberRecordService subscriberRecordService,
            ILogger logger
            )
        {
            Check.If(landlordSubscriberTrackingService).IsNotNull();
            Check.If(applicationService).IsNotNull();
            Check.If(applicationGatherFactory).IsNotNull();
            Check.If(letMeServiceUrlSettings).IsNotNull();
            Check.If(landlordSubscriberTrackingService).IsNotNull();

            _campaignLogic = new List<ICampaignLogic>
            {
                new AddApplicationNoGuarantorEventLogic(applicationGatherFactory, applicationSubscriberTrackingService, logger),
                new NewPropertyAddedEventLogic(applicationGatherFactory, applicationSubscriberTrackingService, letMeServiceUrlSettings, subscriberRecordService, logger),
                new BookAViewingCampaignLogic(applicationGatherFactory, applicationSubscriberTrackingService),
                new DeclinedGuarantorCampaignLogic(applicationGatherFactory, applicationSubscriberTrackingService),
                new NewPropertySubmissionCampaignLogic(landlordGatherFactory,landlordSubscriberTrackingService)
            };
        }
        public EventLogService(IRestService restService, ILetMeServiceUrlSettings urlSettings)
        {
            Check.If(restService).IsNotNull();

            _restService = restService;
            _urlSettings = urlSettings;
        }
        //TODO: Sort this out!
        public static ApplicationSummary GetShortUrls(ApplicationSummary application, string type, ILetMeServiceUrlSettings _settings, IRestService _restService)
        {
            var shortUrl = string.Empty;
            var uri = new Uri($"{_settings.UrlShortenerUrl}/url/shorten");
            var longUrl = new ShortUrlRequest
            {
                Value = $"{_settings.LetMeWebsiteUrl}/Registration/GuarantorDetails/{application.ApplicationReference}"
            };
            var json = _restService.Post(uri, longUrl, ApiOwner.Letme, "");

            shortUrl = !string.IsNullOrEmpty(json) ? _restService.Deserialize<string>(json) : longUrl.Value;

            if (application.ShortUrls == null)
            {
                application.ShortUrls = new List<ShortUrl>();
            }
            else
            {
                application.ShortUrls.Clear();
            }
            application.ShortUrls.Add(new ShortUrl
            {
                Value = shortUrl,
                Type = type
            });

            return application;
        }
        public ApplicationProvider(IRestService restService, ILetMeServiceUrlSettings urlSettings, ILogger logger)
        {
            Check.If(restService).IsNotNull();
            Check.If(urlSettings).IsNotNull();

            _restService = restService;
            _urlSettings = urlSettings;
            _logger = logger;
        }
        public PropertyProvider(IRestService restService, ILetMeServiceEndpoints endpointSettings, ILetMeServiceUrlSettings urlSettings)
        {
            Check.If(endpointSettings).IsNotNull();
            Check.If(urlSettings).IsNotNull();
            Check.If(restService).IsNotNull();

            _restService = restService;
            _endpointSettings = endpointSettings;
            _urlSettings = urlSettings;
        }
        public NewPropertyAddedEventLogic(IDataGatherFactory<ApplicationSummary> dataGatherFactory,
            ISubscriberTrackingService<ApplicationSummary> subscriberTrackingService, ILetMeServiceUrlSettings urlSettings,
            ISubscriberRecordService recordService, ILogger logger)
        {
            Check.If(dataGatherFactory).IsNotNull();
            Check.If(subscriberTrackingService).IsNotNull();
            Check.If(urlSettings).IsNotNull();
            Check.If(recordService).IsNotNull();
            Check.If(logger).IsNotNull();

            _dataGatherFactory = dataGatherFactory;
            _recordService = recordService;
            _logger = logger;
            _subscriberTrackingService = subscriberTrackingService;

            CampaignType = "NewPropertyAdded";
        }
 public LandlordProvider(ILetMeServiceUrlSettings urlSettings, IRestService restService)
 {
     _urlSettings = urlSettings;
     _restService = restService;
 }
 public ShortUrlProvider(IRestService restService, ILetMeServiceUrlSettings urlSettings)
 {
     _restService = restService;
     _urlSettings = urlSettings;
 }