Example #1
0
 public OrderProductDeleteCommandValidation(IBasketDbContext context, IUserContextManager userContextManager, IProductsClient productsClient)
 {
     RuleFor(x => x.OrderId).NotEmpty();
     RuleFor(x => x.OrderId).OrderExists(context, userContextManager);
     RuleFor(x => x.ProductId).NotEmpty();
     RuleFor(x => x.ProductId).ProductExists(productsClient);
 }
 public DebugTestJob(IUserContextManager userContextManager,
                     IUserAuthenticationService userAuthenticationService,
                     IUserAuthorizationService userAuthorizationService,
                     ITracer tracer)
     : base(userContextManager, userAuthenticationService, userAuthorizationService, tracer)
 {
 }
 public OrderViewQueryHandler(IBasketDbContext context, IMapper mapper, IUserContextManager userContextManager, IProductsClient productsClient)
 {
     _context            = context;
     _mapper             = mapper;
     _userContextManager = userContextManager;
     _productsClient     = productsClient;
 }
Example #4
0
 public TvShowController(IGetTVShowsByUser getTVShowsByUser, ILogger logger, IUserContextManager userContextManager, IUserTVShowMappingManager userTVShowMappingManager)
 {
     _getTVShowsByUser         = getTVShowsByUser;
     _logger                   = logger;
     _userContextManager       = userContextManager;
     _userTVShowMappingManager = userTVShowMappingManager;
 }
 public DebugTestJob(IUserContextManager userContextManager,
                     IUserAuthenticationService userAuthenticationService,
                     IUserAuthorizationService userAuthorizationService,
                     IJobExecutionObserver jobExecutionObserver)
     : base(userContextManager, userAuthenticationService, userAuthorizationService, jobExecutionObserver)
 {
 }
Example #6
0
 public CashSchedulerAuthenticationHandler(
     IUserContextManager userContextManager,
     IOptionsMonitor <CashSchedulerAuthenticationOptions> options,
     ILoggerFactory logger,
     UrlEncoder encoder,
     ISystemClock clock
     ) : base(options, logger, encoder, clock)
 {
     UserContextManager = userContextManager;
 }
Example #7
0
        public OrderProductUpdateCommandValidation(IBasketDbContext context, IUserContextManager userContextManager, IProductsClient productsClient)
        {
            _context            = context;
            _userContextManager = userContextManager;

            RuleFor(x => x.OrderId).NotEmpty();
            RuleFor(x => x.OrderId).OrderExists(context, userContextManager);
            RuleFor(x => x.ProductId).NotEmpty();
            RuleFor(x => x.ProductId).ProductExists(productsClient);
            RuleFor(x => x.Quantity).NotEmpty();
            RuleFor(x => x).MustAsync(ProductInOrderAsync).WithErrorCode("ProductNotInOrder");
        }
Example #8
0
 public HeartbeatJob(IUserContextManager userContextManager,
                     IUserAuthenticationService userAuthenticationService,
                     IUserAuthorizationService userAuthorizationService,
                     ITracer tracer,
                     KafkaMessageFlowInfoProvider kafkaMessageFlowInfoProvider,
                     IRepository <SystemStatus> repository,
                     IEventLogger eventLogger)
     : base(userContextManager, userAuthenticationService, userAuthorizationService, tracer)
 {
     _kafkaMessageFlowInfoProvider = kafkaMessageFlowInfoProvider;
     _repository  = repository;
     _eventLogger = eventLogger;
 }
Example #9
0
 public ProcessingJob(
     IMetadataProvider metadataProvider,
     IMessageFlowProcessorFactory messageFlowProcessorFactory,
     IUserContextManager userContextManager,
     IUserAuthenticationService userAuthenticationService,
     IUserAuthorizationService userAuthorizationService,
     ITelemetryPublisher telemetry,
     IJobExecutionObserver jobExecutionObserver)
     : base(userContextManager, userAuthenticationService, userAuthorizationService, jobExecutionObserver)
 {
     _metadataProvider            = metadataProvider;
     _messageFlowProcessorFactory = messageFlowProcessorFactory;
     _telemetry = telemetry;
 }
 public ReportingJob(
     ITelemetryPublisher telemetry,
     IServiceBusSettingsFactory serviceBusSettingsFactory,
     KafkaMessageFlowInfoProvider kafkaMessageFlowInfoProvider,
     IUserContextManager userContextManager,
     IUserAuthenticationService userAuthenticationService,
     IUserAuthorizationService userAuthorizationService,
     IJobExecutionObserver jobExecutionObserver)
     : base(userContextManager, userAuthenticationService, userAuthorizationService, jobExecutionObserver)
 {
     _kafkaMessageFlowInfoProvider = kafkaMessageFlowInfoProvider;
     _telemetry = telemetry;
     _serviceBusSettingsFactory = serviceBusSettingsFactory;
 }
Example #11
0
 public ArchivingJob(
     ArchiveVersionsService archiveVersionsService,
     IArchiveVersionsSettings settings,
     IUserContextManager userContextManager,
     IUserAuthenticationService userAuthenticationService,
     IUserAuthorizationService userAuthorizationService,
     ITracer tracer)
     : base(userContextManager, userAuthenticationService, userAuthorizationService, tracer)
 {
     _archiveVersionsService = archiveVersionsService;
     _settings           = settings;
     _transactionOptions = new TransactionOptions {
         IsolationLevel = IsolationLevel.ReadCommitted, Timeout = TimeSpan.Zero
     };
 }
 public OrderCreateCommandHandler(IBasketDbContext context, IUserContextManager userContextManager)
 {
     _context            = context;
     _userContextManager = userContextManager;
 }
        public static string GetCurrentUserEmail(this IUserContextManager userContextManager)
        {
            var currentUser = userContextManager.GetCurrentUser();

            return(currentUser.FindFirst("preferred_username").Value);
        }
 public static IRuleBuilderOptions <T, Guid> OrderExists <T>(this IRuleBuilderInitial <T, Guid> builder, IBasketDbContext context, IUserContextManager userContextManager)
 {
     return(builder.MustAsync(async(Guid orderId, CancellationToken cancellationToken) =>
     {
         var customerEmail = userContextManager.GetCurrentUserEmail();
         var order = await context.Orders.FirstOrDefaultAsync(x => x.Id == orderId && x.CustomerEmail == customerEmail, cancellationToken);
         return order != null;
     }).WithErrorCode("OrderNotExists"));
 }
Example #15
0
 public UserTVShowMappingManager(IUserContextManager userContextManager, IAddUserTVShowMapping addUserTVShowMapping, IDeleteUserTvShowMapping deleteUserTvShowMapping)
 {
     _userContextManager      = userContextManager;
     _addUserTVShowMapping    = addUserTVShowMapping;
     _deleteUserTvShowMapping = deleteUserTvShowMapping;
 }
 public OrderUpdateCommandValidator(IBasketDbContext context, IUserContextManager userContextManager)
 {
     RuleFor(x => x.OrderId).NotEmpty();
     RuleFor(x => x.Status).IsInEnum();
     RuleFor(x => x.OrderId).OrderExists(context, userContextManager);
 }
 public OrdersViewQueryHandler(IBasketDbContext context, IMapper mapper, IUserContextManager userContextManager)
 {
     _context            = context;
     _mapper             = mapper;
     _userContextManager = userContextManager;
 }