From d5b23718d165ce921b974734527f5536cb243539 Mon Sep 17 00:00:00 2001 From: Iliyan Iliev Date: Mon, 11 May 2020 13:23:44 +0300 Subject: [PATCH] Closes #9 --- .../Events/BonusTypeDetectedEvent.cs | 2 +- ....Service.BonusTriggerAgent.Contract.csproj | 2 +- .../BonusType.cs | 2 +- ...VN.Service.BonusTriggerAgent.Domain.csproj | 2 +- ...ce.BonusTriggerAgent.DomainServices.csproj | 16 ++-- .../CustomerPhoneVerifiedSubscriber.cs | 8 +- .../EmailVerificationSubscriber.cs | 6 +- .../Subscribers/FriendReferralSubscriber.cs | 4 +- .../HotelCheckoutReferralSubscriber.cs | 8 +- .../Subscribers/HotelCheckoutSubscriber.cs | 8 +- .../OfferToPurchaseByLeadSubscriber.cs | 86 ------------------ .../PropertyLeadApprovedReferralSubscriber.cs | 52 ----------- .../PropertyPurchaseFirstRewardSubscriber.cs | 57 ------------ ...rralRealEstatePurchasePaymentSubscriber.cs | 87 ------------------- .../Modules/RabbitMqModule.cs | 37 -------- .../Modules/ServiceModule.cs | 6 +- .../Settings/AppSettings.cs | 6 +- 17 files changed, 35 insertions(+), 354 deletions(-) delete mode 100644 src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/OfferToPurchaseByLeadSubscriber.cs delete mode 100644 src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/PropertyLeadApprovedReferralSubscriber.cs delete mode 100644 src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/PropertyPurchaseFirstRewardSubscriber.cs delete mode 100644 src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/ReferralRealEstatePurchasePaymentSubscriber.cs diff --git a/contract/MAVN.Service.BonusTriggerAgent.Contract/Events/BonusTypeDetectedEvent.cs b/contract/MAVN.Service.BonusTriggerAgent.Contract/Events/BonusTypeDetectedEvent.cs index aa21f42..4e4b3fb 100644 --- a/contract/MAVN.Service.BonusTriggerAgent.Contract/Events/BonusTypeDetectedEvent.cs +++ b/contract/MAVN.Service.BonusTriggerAgent.Contract/Events/BonusTypeDetectedEvent.cs @@ -1,4 +1,4 @@ -using Lykke.Service.PartnerManagement.Client.Models; +using MAVN.Service.PartnerManagement.Client.Models; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/contract/MAVN.Service.BonusTriggerAgent.Contract/MAVN.Service.BonusTriggerAgent.Contract.csproj b/contract/MAVN.Service.BonusTriggerAgent.Contract/MAVN.Service.BonusTriggerAgent.Contract.csproj index c6285fa..512d823 100644 --- a/contract/MAVN.Service.BonusTriggerAgent.Contract/MAVN.Service.BonusTriggerAgent.Contract.csproj +++ b/contract/MAVN.Service.BonusTriggerAgent.Contract/MAVN.Service.BonusTriggerAgent.Contract.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/MAVN.Service.BonusTriggerAgent.Domain/BonusType.cs b/src/MAVN.Service.BonusTriggerAgent.Domain/BonusType.cs index f602997..cc206fb 100644 --- a/src/MAVN.Service.BonusTriggerAgent.Domain/BonusType.cs +++ b/src/MAVN.Service.BonusTriggerAgent.Domain/BonusType.cs @@ -1,4 +1,4 @@ -using Lykke.Service.PartnerManagement.Client.Models; +using MAVN.Service.PartnerManagement.Client.Models; namespace MAVN.Service.BonusTriggerAgent.Domain { diff --git a/src/MAVN.Service.BonusTriggerAgent.Domain/MAVN.Service.BonusTriggerAgent.Domain.csproj b/src/MAVN.Service.BonusTriggerAgent.Domain/MAVN.Service.BonusTriggerAgent.Domain.csproj index ad5ab18..2990505 100644 --- a/src/MAVN.Service.BonusTriggerAgent.Domain/MAVN.Service.BonusTriggerAgent.Domain.csproj +++ b/src/MAVN.Service.BonusTriggerAgent.Domain/MAVN.Service.BonusTriggerAgent.Domain.csproj @@ -4,8 +4,8 @@ 1.0.0 - + diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/MAVN.Service.BonusTriggerAgent.DomainServices.csproj b/src/MAVN.Service.BonusTriggerAgent.DomainServices/MAVN.Service.BonusTriggerAgent.DomainServices.csproj index 9ed7ed2..3092733 100644 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/MAVN.Service.BonusTriggerAgent.DomainServices.csproj +++ b/src/MAVN.Service.BonusTriggerAgent.DomainServices/MAVN.Service.BonusTriggerAgent.DomainServices.csproj @@ -1,4 +1,4 @@ - + netcoreapp2.2 1.0.0 @@ -8,14 +8,14 @@ - - - - - - - + + + + + + + diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/CustomerPhoneVerifiedSubscriber.cs b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/CustomerPhoneVerifiedSubscriber.cs index 2bb5863..289ced3 100644 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/CustomerPhoneVerifiedSubscriber.cs +++ b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/CustomerPhoneVerifiedSubscriber.cs @@ -1,13 +1,13 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Lykke.Common.Log; using Lykke.RabbitMqBroker.Publisher; using MAVN.Service.BonusTriggerAgent.Contract.Events; using MAVN.Service.BonusTriggerAgent.Domain; -using Lykke.Service.CustomerProfile.Client; -using Lykke.Service.CustomerProfile.Client.Models.Enums; -using Lykke.Service.CustomerProfile.Contract; +using MAVN.Service.CustomerProfile.Client; +using MAVN.Service.CustomerProfile.Client.Models.Enums; +using MAVN.Service.CustomerProfile.Contract; namespace MAVN.Service.BonusTriggerAgent.DomainServices.Subscribers { diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/EmailVerificationSubscriber.cs b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/EmailVerificationSubscriber.cs index ae33385..196ee8d 100644 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/EmailVerificationSubscriber.cs +++ b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/EmailVerificationSubscriber.cs @@ -5,9 +5,9 @@ using Lykke.RabbitMqBroker.Publisher; using MAVN.Service.BonusTriggerAgent.Contract.Events; using MAVN.Service.BonusTriggerAgent.Domain; -using Lykke.Service.CustomerProfile.Client; -using Lykke.Service.CustomerProfile.Client.Models.Enums; -using Lykke.Service.CustomerProfile.Contract; +using MAVN.Service.CustomerProfile.Client; +using MAVN.Service.CustomerProfile.Client.Models.Enums; +using MAVN.Service.CustomerProfile.Contract; namespace MAVN.Service.BonusTriggerAgent.DomainServices.Subscribers { diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/FriendReferralSubscriber.cs b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/FriendReferralSubscriber.cs index 6a7c011..ab09ea4 100644 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/FriendReferralSubscriber.cs +++ b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/FriendReferralSubscriber.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Lykke.Common.Log; using Lykke.RabbitMqBroker.Publisher; using MAVN.Service.BonusTriggerAgent.Contract.Events; using MAVN.Service.BonusTriggerAgent.Domain; -using Lykke.Service.Referral.Contract.Events; +using MAVN.Service.Referral.Contract.Events; namespace MAVN.Service.BonusTriggerAgent.DomainServices.Subscribers { diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/HotelCheckoutReferralSubscriber.cs b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/HotelCheckoutReferralSubscriber.cs index 25c6e0a..b2eae80 100644 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/HotelCheckoutReferralSubscriber.cs +++ b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/HotelCheckoutReferralSubscriber.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Common.Log; @@ -6,9 +6,9 @@ using Lykke.RabbitMqBroker.Publisher; using MAVN.Service.BonusTriggerAgent.Contract.Events; using MAVN.Service.BonusTriggerAgent.Domain; -using Lykke.Service.CurrencyConvertor.Client; -using Lykke.Service.CurrencyConvertor.Client.Models.Enums; -using Lykke.Service.Referral.Contract.Events; +using MAVN.Service.CurrencyConvertor.Client; +using MAVN.Service.CurrencyConvertor.Client.Models.Enums; +using MAVN.Service.Referral.Contract.Events; namespace MAVN.Service.BonusTriggerAgent.DomainServices.Subscribers { diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/HotelCheckoutSubscriber.cs b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/HotelCheckoutSubscriber.cs index 5b4068f..68bfacb 100644 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/HotelCheckoutSubscriber.cs +++ b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/HotelCheckoutSubscriber.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Common.Log; @@ -6,9 +6,9 @@ using Lykke.RabbitMqBroker.Publisher; using MAVN.Service.BonusTriggerAgent.Contract.Events; using MAVN.Service.BonusTriggerAgent.Domain; -using Lykke.Service.CurrencyConvertor.Client; -using Lykke.Service.CurrencyConvertor.Client.Models.Enums; -using Lykke.Service.PartnersIntegration.Contract; +using MAVN.Service.CurrencyConvertor.Client; +using MAVN.Service.CurrencyConvertor.Client.Models.Enums; +using MAVN.Service.PartnersIntegration.Contract; namespace MAVN.Service.BonusTriggerAgent.DomainServices.Subscribers { diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/OfferToPurchaseByLeadSubscriber.cs b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/OfferToPurchaseByLeadSubscriber.cs deleted file mode 100644 index 0f959e3..0000000 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/OfferToPurchaseByLeadSubscriber.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Lykke.Common.Log; -using Lykke.RabbitMqBroker.Publisher; -using MAVN.Service.BonusTriggerAgent.Contract.Events; -using MAVN.Service.BonusTriggerAgent.Domain; -using Lykke.Service.CurrencyConvertor.Client; -using Lykke.Service.CurrencyConvertor.Client.Models.Enums; -using Lykke.Service.Referral.Contract.Events; - -namespace MAVN.Service.BonusTriggerAgent.DomainServices.Subscribers -{ - public class OfferToPurchaseByLeadSubscriber - : RabbitSubscriber - { - private readonly string _assetName; - private readonly IRabbitPublisher _bonusTriggerEventPublisher; - private readonly ICurrencyConvertorClient _currencyConverterClient; - - public OfferToPurchaseByLeadSubscriber( - string connectionString, - string exchangeName, - string assetName, - ILogFactory logFactory, - IRabbitPublisher bonusTriggerEventPublisher, - ICurrencyConvertorClient currencyConverterClient - ) - : base(connectionString, exchangeName, logFactory) - { - _bonusTriggerEventPublisher = bonusTriggerEventPublisher ?? - throw new ArgumentNullException(nameof(bonusTriggerEventPublisher)); - _currencyConverterClient = currencyConverterClient ?? - throw new ArgumentNullException(nameof(currencyConverterClient)); - _assetName = assetName; - } - - public override async Task ProcessMessageAsync(OfferToPurchaseByLeadEvent message) - { - if (string.IsNullOrWhiteSpace(message.CurrencyCode)) - { - Log.Error(null, "Currency is missing in Purchase Referral event", context: message, process: nameof(ProcessMessageAsync)); - return false; - } - - var amount = 0M; - if (message.NetPropertyPrice.HasValue) - { - amount = message.NetPropertyPrice.Value; - } - - if (amount < 0) - { - Log.Error(null, "Amount has invalid value in Purchase Referral Event", context: message, process: nameof(ProcessMessageAsync)); - return false; - } - - var response = await _currencyConverterClient.Converter - .ConvertAsync(message.CurrencyCode, _assetName, amount); - - if (response.ErrorCode != ConverterErrorCode.None) - { - Log.Error(message: "An error occured while converting currency amount", - context: $"from: {message.CurrencyCode}; to: {_assetName}; error: {response.ErrorCode}"); - - return false; - } - - await _bonusTriggerEventPublisher.PublishAsync(new BonusTriggerEvent - { - CustomerId = message.AgentId, - TimeStamp = message.TimeStamp, - Type = BonusTypes.OfferToPurchaseByLead.EventName, - Data = new Dictionary() - { - {"Amount", response.Amount.ToString("G")}, - {"StakedCampaignId", message.CampaignId.ToString("D")}, - {"UnitLocationCode", message.UnitLocationCode}, - {"ReferralId", message.ReferralId} - } - }); - - return true; - } - } -} diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/PropertyLeadApprovedReferralSubscriber.cs b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/PropertyLeadApprovedReferralSubscriber.cs deleted file mode 100644 index 1d3017e..0000000 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/PropertyLeadApprovedReferralSubscriber.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Lykke.Common.Log; -using Lykke.RabbitMqBroker.Publisher; -using MAVN.Service.BonusTriggerAgent.Contract.Events; -using MAVN.Service.BonusTriggerAgent.Domain; -using Lykke.Service.Referral.Contract.Events; - -namespace MAVN.Service.BonusTriggerAgent.DomainServices.Subscribers -{ - public class PropertyLeadApprovedReferralSubscriber : RabbitSubscriber - { - private readonly IRabbitPublisher _bonusTriggerEventPublisher; - - public PropertyLeadApprovedReferralSubscriber( - string connectionString, - string exchangeName, - ILogFactory logFactory, - IRabbitPublisher bonusTriggerEventPublisher) - : base(connectionString, exchangeName, logFactory) - { - _bonusTriggerEventPublisher = bonusTriggerEventPublisher ?? - throw new ArgumentNullException(nameof(bonusTriggerEventPublisher)); - - GuidsFieldsToValidate.Add(nameof(PropertyLeadApprovedReferralEvent.ReferrerId)); - } - - public override async Task ProcessMessageAsync(PropertyLeadApprovedReferralEvent message) - { - var bonusTriggerEvent = new BonusTriggerEvent - { - CustomerId = message.ReferrerId, - TimeStamp = message.TimeStamp, - Type = BonusTypes.PropertyLeadApprovedReferral.EventName, - Data = new Dictionary() - { - {"ReferralId", message.ReferralId} - } - }; - - if (message.StakedCampaignId.HasValue) - { - bonusTriggerEvent.Data.Add("StakedCampaignId", message.StakedCampaignId.Value.ToString()); - } - - await _bonusTriggerEventPublisher.PublishAsync(bonusTriggerEvent); - - return true; - } - } -} diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/PropertyPurchaseFirstRewardSubscriber.cs b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/PropertyPurchaseFirstRewardSubscriber.cs deleted file mode 100644 index 3b6c2a7..0000000 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/PropertyPurchaseFirstRewardSubscriber.cs +++ /dev/null @@ -1,57 +0,0 @@ -//using System; -//using System.Collections.Generic; -//using System.Threading.Tasks; -//using Lykke.Common.Log; -//using Lykke.RabbitMqBroker.Publisher; -//using MAVN.Service.BonusTriggerAgent.Contract.Events; -//using MAVN.Service.BonusTriggerAgent.Domain; -//using Lykke.Service.MAVNPropertyIntegration.Contract.MAVNEvents; - -//namespace MAVN.Service.BonusTriggerAgent.DomainServices.Subscribers -//{ -// public class PropertyPurchaseFirstRewardSubscriber -// : RabbitSubscriber -// { -// private readonly IRabbitPublisher _bonusTriggerEventPublisher; - -// public PropertyPurchaseFirstRewardSubscriber( -// string connectionString, -// string exchangeName, -// IRabbitPublisher bonusTriggerEventPublisher, -// ILogFactory logFactory) -// : base(connectionString, exchangeName, logFactory) -// { -// _bonusTriggerEventPublisher = bonusTriggerEventPublisher -// ?? throw new ArgumentNullException(nameof(bonusTriggerEventPublisher)); -// } - -// public override async Task ProcessMessageAsync(MAVNPropertyPurchaseFirstRewardEvent message) -// { -// // Having customer id null here is valid case -// if (string.IsNullOrEmpty(message.BuyerCustomerId)) -// return true; - -// var amount = message.NetPropertyPrice ?? 0M; - -// if (amount < 0) -// { -// Log.Error(null, "Amount has invalid value in Purchase Referral Event", context: message, process: nameof(ProcessMessageAsync)); -// return false; -// } - -// await _bonusTriggerEventPublisher.PublishAsync(new BonusTriggerEvent -// { -// CustomerId = message.BuyerCustomerId, -// TimeStamp = message.Timestamp, -// Type = BonusTypes.PropertyPurchaseFirstReward.EventName, -// Data = new Dictionary() -// { -// {"Amount", amount.ToString("G")}, -// {"UnitLocationCode", message.UnitLocationCode} -// } -// }); - -// return true; -// } -// } -//} diff --git a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/ReferralRealEstatePurchasePaymentSubscriber.cs b/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/ReferralRealEstatePurchasePaymentSubscriber.cs deleted file mode 100644 index 9c7cb66..0000000 --- a/src/MAVN.Service.BonusTriggerAgent.DomainServices/Subscribers/ReferralRealEstatePurchasePaymentSubscriber.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Lykke.Common.Log; -using Lykke.RabbitMqBroker.Publisher; -using MAVN.Service.BonusTriggerAgent.Contract.Events; -using MAVN.Service.BonusTriggerAgent.Domain; -using Lykke.Service.CurrencyConvertor.Client; -using Lykke.Service.CurrencyConvertor.Client.Models.Enums; -using Lykke.Service.RealEstateBonusAgent.Contract.Events; - -namespace MAVN.Service.BonusTriggerAgent.DomainServices.Subscribers -{ - public class ReferralRealEstatePurchasePaymentSubscriber : RabbitSubscriber - { - private readonly string _assetName; - private readonly IRabbitPublisher _bonusTriggerEventPublisher; - private readonly ICurrencyConvertorClient _currencyConverterClient; - - public ReferralRealEstatePurchasePaymentSubscriber( - string connectionString, - string exchangeName, - string assetName, - ILogFactory logFactory, - IRabbitPublisher bonusTriggerEventPublisher, - ICurrencyConvertorClient currencyConverterClient) - : base(connectionString, exchangeName, logFactory) - { - _bonusTriggerEventPublisher = bonusTriggerEventPublisher ?? - throw new ArgumentNullException(nameof(bonusTriggerEventPublisher)); - _currencyConverterClient = currencyConverterClient ?? - throw new ArgumentNullException(nameof(currencyConverterClient)); - _assetName = assetName; - - GuidsFieldsToValidate.Add(nameof(ReferralRealEstatePurchasePaymentEvent.CustomerId)); - GuidsFieldsToValidate.Add(nameof(ReferralRealEstatePurchasePaymentEvent.ReferralId)); - } - - public override async Task ProcessMessageAsync(ReferralRealEstatePurchasePaymentEvent message) - { - if (string.IsNullOrWhiteSpace(message.CurrencyCode)) - { - Log.Error(null, "Currency is missing in Referral Property First Purchase Event", context: message, process: nameof(ProcessMessageAsync)); - return false; - } - - var amount = message.NetPropertyAmount; - - if (amount < 0) - { - Log.Error(null, "NetPropertyAmount has invalid value in Referral Property First Purchase Event", context: message, process: nameof(ProcessMessageAsync)); - return false; - } - - var response = await _currencyConverterClient.Converter - .ConvertAsync(message.CurrencyCode, _assetName, amount); - - if (response.ErrorCode != ConverterErrorCode.None) - { - Log.Error(message: "An error occured while converting currency amount", - context: $"from: {message.CurrencyCode}; to: {_assetName}; error: {response.ErrorCode}"); - - return false; - } - - var bonusTriggerEvent = new BonusTriggerEvent - { - CustomerId = message.CustomerId, - TimeStamp = DateTime.UtcNow, - Type = BonusTypes.ReferralPropertyFirstPurchase.EventName, - Data = new Dictionary() - { - {"Amount", response.Amount.ToString("G")}, - {"IsDownPayment", message.IsDownPayment.ToString()}, - {"PurchaseCompletionPercentage", message.PurchaseCompletionPercentage.ToString() }, - {"PaymentId", message.ReferralId }, - {"StakedCampaignId", message.CampaignId.ToString("D")}, - {"UnitLocationCode", message.UnitLocationCode} - } - }; - - await _bonusTriggerEventPublisher.PublishAsync(bonusTriggerEvent); - - return true; - } - } -} diff --git a/src/MAVN.Service.BonusTriggerAgent/Modules/RabbitMqModule.cs b/src/MAVN.Service.BonusTriggerAgent/Modules/RabbitMqModule.cs index 2bd8c70..a891100 100644 --- a/src/MAVN.Service.BonusTriggerAgent/Modules/RabbitMqModule.cs +++ b/src/MAVN.Service.BonusTriggerAgent/Modules/RabbitMqModule.cs @@ -12,11 +12,6 @@ namespace MAVN.Service.BonusTriggerAgent.Modules [UsedImplicitly] public class RabbitMqModule : Module { - private const string PropertyFirstPurchaseExchangeName = "lykke.mavn.propertyintegration.propertypurchasefirstreward"; - private const string ReferralRealEstatePurchasePaymentExchangeName = "lykke.bonus.realestatepurchasepayment"; - private const string PropertyLeadApprovedReferralExchangeName = "lykke.bonus.propertyleadapprovedreferral"; - private const string OfferToPurchaseByLeadExchangeName = "lykke.bonus.purchasereferral.offertopurchasebylead"; - private const string BonusTriggerExchangeName = "lykke.bonus.trigger"; private const string BonusTypesExchangeName = "lykke.bonus.types"; private const string CustomerPhoneVerifiedExchangeName = "lykke.customer.phoneverified"; @@ -84,38 +79,6 @@ protected override void Load(ContainerBuilder builder) .WithParameter("connectionString", _settings.ReferralConnectionString) .WithParameter("exchangeName", HotelCheckoutReferralExchangeName) .WithParameter("assetName", _baseCurrencyCode); - - if (!_isRealEstateFeatureDisabled) - RegisterSubscribersForRealEstateFeature(builder); - } - - private void RegisterSubscribersForRealEstateFeature(ContainerBuilder builder) - { - builder.RegisterType() - .As() - .SingleInstance() - .WithParameter("connectionString", _settings.RabbitMqConnectionString) - .WithParameter("exchangeName", PropertyLeadApprovedReferralExchangeName); - - builder.RegisterType() - .As() - .SingleInstance() - .WithParameter("connectionString", _settings.RabbitMqConnectionString) - .WithParameter("exchangeName", ReferralRealEstatePurchasePaymentExchangeName) - .WithParameter("assetName", _baseCurrencyCode); - - //builder.RegisterType() - // .As() - // .SingleInstance() - // .WithParameter("connectionString", _settings.RabbitMqConnectionString) - // .WithParameter("exchangeName", PropertyFirstPurchaseExchangeName); - - builder.RegisterType() - .As() - .SingleInstance() - .WithParameter("connectionString", _settings.RabbitMqConnectionString) - .WithParameter("exchangeName", OfferToPurchaseByLeadExchangeName) - .WithParameter("assetName", _baseCurrencyCode); } } } diff --git a/src/MAVN.Service.BonusTriggerAgent/Modules/ServiceModule.cs b/src/MAVN.Service.BonusTriggerAgent/Modules/ServiceModule.cs index 852dd65..805327b 100644 --- a/src/MAVN.Service.BonusTriggerAgent/Modules/ServiceModule.cs +++ b/src/MAVN.Service.BonusTriggerAgent/Modules/ServiceModule.cs @@ -1,11 +1,11 @@ -using Autofac; +using Autofac; using JetBrains.Annotations; using Lykke.Sdk; using MAVN.Service.BonusTriggerAgent.DomainServices; using MAVN.Service.BonusTriggerAgent.Managers; using MAVN.Service.BonusTriggerAgent.Settings; -using Lykke.Service.CurrencyConvertor.Client; -using Lykke.Service.CustomerProfile.Client; +using MAVN.Service.CurrencyConvertor.Client; +using MAVN.Service.CustomerProfile.Client; using Lykke.SettingsReader; namespace MAVN.Service.BonusTriggerAgent.Modules diff --git a/src/MAVN.Service.BonusTriggerAgent/Settings/AppSettings.cs b/src/MAVN.Service.BonusTriggerAgent/Settings/AppSettings.cs index 456dddd..638ce2f 100644 --- a/src/MAVN.Service.BonusTriggerAgent/Settings/AppSettings.cs +++ b/src/MAVN.Service.BonusTriggerAgent/Settings/AppSettings.cs @@ -1,7 +1,7 @@ -using JetBrains.Annotations; +using JetBrains.Annotations; using Lykke.Sdk.Settings; -using Lykke.Service.CurrencyConvertor.Client; -using Lykke.Service.CustomerProfile.Client; +using MAVN.Service.CurrencyConvertor.Client; +using MAVN.Service.CustomerProfile.Client; namespace MAVN.Service.BonusTriggerAgent.Settings {