Esempio n. 1
0
 public DetailsDeleteCommand(TelegramBotClient telegramBot, Message message, CallbackQuery query)
 {
     this.telegramBot    = telegramBot;
     this.message        = message;
     this.query          = query;
     orderDetailsService = InjectDependency.GetInstance().GetOrderDetailsService();
 }
Esempio n. 2
0
        public PizzaOrderQuery(IOrderDetailsService orderDetailsService, IPizzaDetailsService pizzaDetailsService)
        {
            Name = nameof(PizzaOrderQuery);
            //this.AuthorizeWith(Constants.AuthPolicy.CustomerPolicy, Constants.AuthPolicy.RestaurantPolicy);

            FieldAsync <ListGraphType <OrderDetailsType> >(
                name: "newOrders",
                resolve: async context => await orderDetailsService.GettAllNewOrdersAsync());
            //.AuthorizeWith(Constants.AuthPolicy.RestaurantPolicy);


            FieldAsync <PizzaDetailsType>(
                name: "pizzaDetails",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "id"
            }),
                resolve: async context => await pizzaDetailsService.GetPizzaDetailsAsync(context.GetArgument <int>("id")));



            FieldAsync <OrderDetailsType>(
                name: "orderDetails",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "id"
            }),
                resolve: async context => await orderDetailsService.GetOrderDetailsAsync(context.GetArgument <int>("id")));
        }
 public OrdersController(IProductsService prodService, IOrdersService orderService, ICartsService cartsService, IOrderDetailsService orderDetailsService)
 {
     _prodService        = prodService;
     _orderService       = orderService;
     _cartService        = cartsService;
     _orderDetailService = orderDetailsService;
 }
Esempio n. 4
0
 public OrderDetailsController(IOrdersService ordersService, IProductsService productsService, IOrderDetailsService orderDetailsService, IWebHostEnvironment environment)
 {
     _productsService     = productsService;
     _ordersService       = ordersService;
     _orderDetailsService = orderDetailsService;
     _environment         = environment;
 }
Esempio n. 5
0
 public CartController(IProductsService productsService, IOrdersService Order, ICartsItemService CartItemService, ICartsService cartService, IOrderDetailsService OrderDetail)
 {
     _productsService  = productsService;
     _cartItemsService = CartItemService;
     _cartService      = cartService;
     _OrderService     = Order;
     _OrderDetail      = OrderDetail;
 }
Esempio n. 6
0
        public MockOrdersService(ICustomersService customersService, IOrderDetailsService orderDetailsService)
        {
            _customersService    = customersService;
            _orderDetailsService = orderDetailsService;
            _random = new Random();

            GenerateMockData();
        }
Esempio n. 7
0
 public BasketController(IProductsService productsService, ILogger <BasketController> logger, IOrderDetailsService orderDetailsService, IOrdersService ordersService, IMapper mapper)
 {
     _productsService     = productsService;
     _orderDetailsService = orderDetailsService;
     _ordersService       = ordersService;
     _mapper = mapper;
     _logger = logger;
 }
 public CartsController(ICartsService cartsService, IOrdersService ordersService,
                        IOrderDetailsService orderDetailsService, ILogger <HomeController> logger)
 {
     _cartsService        = cartsService;
     _ordersService       = ordersService;
     _orderDetailsService = orderDetailsService;
     _logger = logger;
 }
Esempio n. 9
0
 public OrderDetailsController(IOrderDetailsService orderDetailsService,
                               IAsyncViewModelFactory <ModifyOrderDetailsViewModel, ModifyOrderDetailsViewModel> orderDetailsViewModelFactory,
                               IMapper mapper)
 {
     _orderDetailsService = orderDetailsService;
     _modifyOrderDetailsViewModelFactory = orderDetailsViewModelFactory;
     _mapper = mapper;
 }
Esempio n. 10
0
 public CartController(IProductsService productsService, IOrderDetailsService orderDetailsService, IOrdersService ordersService, ICartService cartService, ICategoriesService categoriesService)
 {
     _productsService     = productsService;
     _ordersService       = ordersService;
     _cartService         = cartService;
     _categoriesService   = categoriesService;
     _orderDetailsService = orderDetailsService;
 }
Esempio n. 11
0
 public OrderClientService(
     EOrderDbContext dbContext,
     IMapper mapper,
     Resources resources,
     IOrderDetailsService orderDetailsService) :
     base(dbContext, mapper, resources)
 {
     _orderDetailsService = orderDetailsService;
 }
Esempio n. 12
0
        public void Setup()
        {
            _orderService        = A.Fake <IOrderService>();
            _orderDetailsService = A.Fake <IOrderDetailsService>();
            _gameService         = A.Fake <IGameService>();
            _mapper = A.Fake <IMapper>();

            _basketService = new BasketService(_gameService, _orderService, _orderDetailsService, _mapper);
        }
        public void Setup()
        {
            _unitOfWork            = A.Fake <IUnitOfWork>();
            _orderDetailsDecorator = A.Fake <IAsyncRepository <OrderDetails> >();
            _gameService           = A.Fake <IGameService>();
            _mapper = A.Fake <IMapper>();
            A.CallTo(() => _unitOfWork.GetRepository <IAsyncRepository <OrderDetails> >()).Returns(_orderDetailsDecorator);

            _orderDetailsService = new OrderDetailsService(_unitOfWork, _gameService, _mapper);
        }
        public PizzaOrderMutation(IPizzaDetailsService pizzaDetailsService, IOrderDetailsService orderDetailsService)
        {
            Name = nameof(PizzaOrderMutation);

            FieldAsync <OrderDetailsType>(
                name: "createOrder",
                arguments: new QueryArguments(new QueryArgument <NonNullGraphType <OrderDetailsInputType> > {
                Name = "orderDetails"
            }),
                resolve: async context =>
            {
                var order = context.GetArgument <OrderDetailsModel>("orderDetails");

                var orderDetails = new OrderDetails(order.AddressLine1, order.AddressLine2, order.MobileNo, order.Amount);
                orderDetails     = await orderDetailsService.CreateAsync(orderDetails);

                var pizzaDetails = order.PizzaDetails.Select(x => new PizzaDetails(x.Name, x.Toppings, x.Price, x.Size, orderDetails.Id));
                pizzaDetails     = await pizzaDetailsService.CreateBulkAsync(pizzaDetails, orderDetails.Id);

                orderDetails.PizzaDetails = pizzaDetails.ToList();
                return(orderDetails);
            });

            FieldAsync <OrderDetailsType>(
                name: "updateStatus",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <IntGraphType> > {
                Name = "id"
            },
                    new QueryArgument <NonNullGraphType <OrderStatusEnumType> > {
                Name = "status"
            }),
                resolve: async context =>
            {
                int orderId             = context.GetArgument <int>("id");
                OrderStatus orderStatus = context.GetArgument <OrderStatus>("status");

                return(await orderDetailsService.UpdateStatusAsync(orderId, orderStatus));
            });


            FieldAsync <OrderDetailsType>(
                name: "deletePizzaDetails",
                arguments: new QueryArguments(new QueryArgument <NonNullGraphType <IntGraphType> > {
                Name = "pizzaDetailsId"
            }),
                resolve: async context =>
            {
                int pizzaDetailsId = context.GetArgument <int>("pizzaDetailsId");

                int orderId = await pizzaDetailsService.DeletePizzaDetailsAsync(pizzaDetailsId);

                return(await orderDetailsService.GetOrderDetailsAsync(orderId));
            });
        }
Esempio n. 15
0
 public BasketService(
     IGameService gameService,
     IOrderService orderService,
     IOrderDetailsService orderDetailsService,
     IMapper mapper)
 {
     _gameService         = gameService;
     _orderService        = orderService;
     _orderDetailsService = orderDetailsService;
     _mapper = mapper;
 }
Esempio n. 16
0
 public MainWindow()
 {
     InitializeComponent();
     _cs  = new CategoryService();
     _ps  = new ProductService();
     _os  = new OrderService();
     _ods = new OrderDetailsService();
     bc   = new BrushConverter();
     //Timer.TimerStart();
     //Timer.tick(null, null);
     //txtb_date.Text = Timer.date.ToString(); //TODO timer eklenecek
 }
Esempio n. 17
0
 public OrdersController(ILogger <OrdersController> logger,
                         IOrderService orderService,
                         ICartService cartService, IOrderDetailsService orderDetailsService, IErrorService errorService, ICakeService cakeService, IEmailService emailService)
 {
     this.logger              = logger;
     this.orderService        = orderService;
     this.cartService         = cartService;
     this.orderDetailsService = orderDetailsService;
     this.errorService        = errorService;
     this.cakeService         = cakeService;
     this.emailService        = emailService;
 }
Esempio n. 18
0
        public void Setup()
        {
            _orderDetailsService = A.Fake <IOrderDetailsService>();
            _modifyOrderDetailsViewModelFactory =
                A.Fake <IAsyncViewModelFactory <ModifyOrderDetailsViewModel, ModifyOrderDetailsViewModel> >();
            _mapper = A.Fake <IMapper>();

            _orderDetailsController = new OrderDetailsController(
                _orderDetailsService,
                _modifyOrderDetailsViewModelFactory,
                _mapper);
        }
Esempio n. 19
0
 public ProductsController(IProductsService productsService,
                           ICategoriesService categoriesService, ICartsService cartsService,
                           IOrdersService ordersService, IOrderDetailsService orderDetailsService,
                           IWebHostEnvironment env, ILogger <ProductsController> logger)
 {
     _productsService     = productsService;
     _categoriesService   = categoriesService;
     _cartsService        = cartsService;
     _ordersService       = ordersService;
     _orderDetailsService = orderDetailsService;
     _env    = env;
     _logger = logger;
 }
Esempio n. 20
0
 public BasketController(
     IOrderService orderService,
     IOrderDetailsService orderDetailsService,
     IIBoxPaymentResultBuilder iBoxPaymentResultBuilder,
     IGameService gameService,
     IPaymentService paymentService,
     IEmailService emailService,
     ISmsService smsService)
 {
     _orderService             = orderService;
     _orderDetailsService      = orderDetailsService;
     _iBoxPaymentResultBuilder = iBoxPaymentResultBuilder;
     _gameService    = gameService;
     _paymentService = paymentService;
     _emailService   = emailService;
     _smsService     = smsService;
 }
Esempio n. 21
0
        public ShoppingCartController(
            IProductsService productService,
            IOrderService orderService,
            IOrderDetailsService orderDetailsService,
            IContactInfoService contactInfoService,
            IUserService userService)
        {
            Guard.WhenArgument(productService, "productService").IsNull().Throw();
            Guard.WhenArgument(orderService, "orderService").IsNull().Throw();
            Guard.WhenArgument(orderDetailsService, "orderDetailsService").IsNull().Throw();
            Guard.WhenArgument(contactInfoService, "contactInfoService").IsNull().Throw();
            Guard.WhenArgument(userService, nameof(userService)).IsNull().Throw();

            this.productService      = productService;
            this.orderService        = orderService;
            this.orderDetailsService = orderDetailsService;
            this.contactInfoService  = contactInfoService;
            this.userService         = userService;
        }
Esempio n. 22
0
 public OrderController(
     IUnitOfWork unitOfWork,
     IOrderService orderService,
     IOrderDetailsService orderDetailsService,
     IEmailSenderService emailSenderService,
     ILogger <OrderController> logger,
     IProductClientService productClientService,
     IStatusCartsService statusCartsService,
     IStatisticsService statisticsService,
     IHttpContextAccessor httpContextAccessor)
 {
     _unitOfWork          = unitOfWork;
     _orderService        = orderService;
     _orderDetailsService = orderDetailsService;
     _httpContextAccessor = httpContextAccessor;
     _emailSenderService  = emailSenderService;
     _statisticsService   = statisticsService;
     _logger = logger;
     _productClientService = productClientService;
     _statusCartsService   = statusCartsService;
 }
 public OrderDetailsController(IOrderDetailsService _service)
 {
     service = _service;
 }
 public ShoppingCartController(IOrderDetailsService orderDetService, ICartProdsService cartProdsService, ILoggerFactory logger)
 {
     _orderDetService  = orderDetService;
     _cartProdsService = cartProdsService;
     _logger           = logger.CreateLogger <ShoppingCartController>();
 }
Esempio n. 25
0
        public PizzaOrderQuery(IOrderDetailsService orderDetailsService, IPizzaDetailsService pizzaDetailsService)
        {
            Name = nameof(PizzaOrderQuery);
            //this.AuthorizeWith(Constants.AuthPolicy.CustomerPolicy, Constants.AuthPolicy.RestaurantPolicy);

            FieldAsync <ListGraphType <OrderDetailsType> >(
                name: "newOrders",
                resolve: async context => await orderDetailsService.GettAllNewOrdersAsync());
            //.AuthorizeWith(Constants.AuthPolicy.RestaurantPolicy);

            FieldAsync <PizzaDetailsType>(
                name: "pizzaDetails",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "id"
            }),
                resolve: async context => await pizzaDetailsService.GetPizzaDetailsAsync(context.GetArgument <int>("id")));

            FieldAsync <OrderDetailsType>(
                name: "orderDetails",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "id"
            }),
                resolve: async context => await orderDetailsService.GetOrderDetailsAsync(context.GetArgument <int>("id")))
            .AuthorizeWith(Constants.AuthPolicy.AdminPolicy);

            Connection <OrderDetailsType>()
            .Name("completedOrders")
            .Unidirectional()
            .PageSize(10)
            .Argument <CompletedOrderOrderByInputType>("orderBy", "Pass field & direction on which you want to sort data")
            .ResolveAsync(async context =>
            {
                var pageRequest = new PageRequest
                {
                    First   = context.First,
                    Last    = context.Last,
                    After   = context.After,
                    Before  = context.Before,
                    OrderBy = context.GetArgument <SortingDetails <CompletedOrdersSortingFields> >("orderBy")
                };

                var pageResponse = await orderDetailsService.GetCompletedOrdersAsync(pageRequest);

                (string startCursor, string endCursor) = CursorHelper.GetFirstAndLastCursor(pageResponse.Nodes.Select(x => x.Id));

                var edge = pageResponse.Nodes.Select(x => new Edge <OrderDetails>
                {
                    Cursor = CursorHelper.ToCursor(x.Id),
                    Node   = x
                }).ToList();

                var connection = new Connection <OrderDetails>()
                {
                    Edges      = edge,
                    TotalCount = pageResponse.TotalCount,
                    PageInfo   = new PageInfo
                    {
                        HasNextPage     = pageResponse.HasNextPage,
                        HasPreviousPage = pageResponse.HasPreviousPage,
                        StartCursor     = startCursor,
                        EndCursor       = endCursor
                    }
                };

                return(connection);
            });

            Field <PizzaDetailsType>(
                name: "exceptionDemo",
                resolve: context =>
            {
                var data = new Dictionary <string, string>
                {
                    { "key", "value" }
                };

                var ex = new ExecutionError("Some error message", data);
                ex.AddLocation(20, 500);
                context.Errors.Add(ex);

                return(pizzaDetailsService.GetPizzaDetailsOrError());
            });
        }
Esempio n. 26
0
 public OrderDetailsController(
     IOrderDetailsService OrderDetailsService) :
     base(OrderDetailsService)
 {
 }
Esempio n. 27
0
 public OrdersController(IOrdersService ordersService, IOrderDetailsService orderDetailsService)
 {
     this.ordersService       = ordersService;
     this.orderDetailsService = orderDetailsService;
 }
Esempio n. 28
0
 public OrderDetailController(IOrderDetailsService orderDetailsService)
 {
     _orderDetailsService = orderDetailsService;
 }
Esempio n. 29
0
 public OrderManager(IOrderDal orderDal, IOrderDetailsService orderDetailsService)
 {
     _orderDal            = orderDal;
     _orderDetailsService = orderDetailsService;
 }
Esempio n. 30
0
 //User manager is required to use User.Identity
 public OrdersController(IOrdersService ordersService, IOrderDetailsService orderDetailsService, UserManager <IdentityUser> userManager, IProductsService productsService)
 {
     _ordersService       = ordersService;
     _orderDetailsService = orderDetailsService;
     _productsService     = productsService;
 }