예제 #1
0
 public UserController(IBalanceManager balanceManager,
                       IUserManager userManager, ILogger <UserController> logger)
 {
     _balanceManager = balanceManager;
     _userManager    = userManager;
     _logger         = logger;
 }
예제 #2
0
 public ProductManager(ICategoryHandler categoryHandler, IProductHandler productHandler, IBalanceManager balanceManager, IPaymentManager paymentManager)
 {
     _categoryHandler = categoryHandler ?? throw new System.ArgumentNullException(nameof(_categoryHandler));
     _productHandler  = productHandler ?? throw new System.ArgumentNullException(nameof(_productHandler));
     _balanceManager  = balanceManager ?? throw new System.ArgumentNullException(nameof(_balanceManager));
     _paymentManager  = paymentManager ?? throw new System.ArgumentNullException(nameof(_paymentManager));
 }
예제 #3
0
 public CasinoEngine(IReader reader, IWriter writer, ICommandManager commandManager, IBalanceManager balanceManager, IMath mathProvider, IPlaySlotCommand playSlotCommand)
 {
     this.reader          = reader;
     this.writer          = writer;
     this.commandManager  = commandManager;
     this.balanceManager  = balanceManager;
     this.mathProvider    = mathProvider;
     this.playSlotCommand = playSlotCommand;
 }
예제 #4
0
 public EWork(ITagManager tagManager,
              IJobManager jobManager,
              IUserExtractor userExtractor,
              IReviewManager reviewManager,
              IBalanceManager balanceManager,
              IProposalManager proposalManager,
              INotificationManager notificationManager
              )
 {
     TagManager          = tagManager;
     JobManager          = jobManager;
     UserExtractor       = userExtractor;
     ReviewManager       = reviewManager;
     BalanceManager      = balanceManager;
     ProposalManager     = proposalManager;
     NotificationManager = notificationManager;
 }
 public AutoTradingProcessor(
     IOptions <AppSettings> settings,
     ILogger <AutoTradingProcessor> logger,
     IOrderProcessor orderProcessor,
     IBalanceManager balanceManager,
     ITradesManager tradesManager,
     IOrderManager orderManager,
     IBookManager bookManager,
     IDealManager dealManager,
     DealProcessor dealProcessor,
     NatsConnector connector) : base(settings, logger)
 {
     _logger         = logger;
     _orderProcessor = orderProcessor;
     _balanceManager = balanceManager;
     _dealManager    = dealManager;
     _tradesManager  = tradesManager;
     _orderManager   = orderManager;
     _dealProcessor  = dealProcessor;
     _bookManager    = bookManager;
     _connector      = connector;
     _settings       = settings;
 }
예제 #6
0
        protected virtual void TryRollback(IBalanceManager balanceManager, string balanceName, string transactionId)
        {
            var checkErroCode = balanceManager.CheckTransaction(transactionId);

            if (checkErroCode == ErrorCode.Success)
            {
                var rollbackErrorCode = balanceManager.Rollback(transactionId);
                if (rollbackErrorCode == ErrorCode.Success)
                {
                    Exception.LogRollbackSuccess(balanceName);
                }
                else
                {
                    if (rollbackErrorCode == ErrorCode.UnknownError && TransactionRollbacked(balanceManager, transactionId))
                    {
                        Exception.LogRollbackSuccess(balanceName);
                    }
                    else
                    {
                        Exception.LogRollbackFailure(balanceName, rollbackErrorCode.ToString());
                    }
                }
            }
        }
예제 #7
0
 public BalanceOperator(IBalanceManager from, IBalanceManager to)
 {
     _from = from;
     _to   = to;
 }
예제 #8
0
 public FreelancingPlatformBalanceChecker(IBalanceManager balanceManager)
 => _balanceManager = balanceManager;
 public CommandHandler(IGarbageProcessor garbageProcessor, IBalanceManager balanceManager)
 {
     this.GarbageProcessor = garbageProcessor;
     this.BalanceManager   = balanceManager;
     this.InitializeStrategies();
 }
 public BalanceController()
 {
     _casinoBalanceManager = new CasinoBalanceManager();
     _gameBalanceManager   = new GameBalanceManager();
 }
예제 #11
0
 public BaseBalanceCommandHandler(ServiceResolver resolver)
 {
     _casinoBalanceManager = resolver(AppConstants.CasinoBalance);
     _gameBalanceManager   = resolver(AppConstants.GameBalance);
 }
예제 #12
0
        private bool TransactionRollbacked(IBalanceManager balanceManager, string transactionId)
        {
            var checkRollbackErrorCode = balanceManager.CheckTransaction(transactionId);

            return(checkRollbackErrorCode == ErrorCode.TransactionRollbacked);
        }
예제 #13
0
 public BalanceController(BalanceFactory factory)
 {
     _factory       = factory;
     _gameManager   = _factory.GetManagerService(BalanceFactoryType.Game);
     _casinoManager = _factory.GetManagerService(BalanceFactoryType.Casino);
 }
예제 #14
0
 public BalanceProcessor(IOptions <AppSettings> settings, ILogger logger, IBalanceManager balanceManager) : base(settings, logger)
 {
     _balanceManager = balanceManager;
 }
예제 #15
0
 public GetCasinoBalanceQueryHandler(ServiceResolver resolver)
 {
     _casinoBalanceManager = resolver(AppConstants.CasinoBalance);
 }