public void Setup()
        {
            _productAttributeService        = Resolve <IProductAttributeService>();
            _productService                 = Resolve <IProductService>();
            _availableAttributeService      = Resolve <IAvailableAttributeService>();
            _availableAttributeValueService = Resolve <IAvailableAttributeValueService>();
            _vendorService             = Resolve <IVendorService>();
            _manufacturerService       = Resolve <IManufacturerService>();
            _productVariantService     = Resolve <IProductVariantService>();
            _productAccountant         = Resolve <IProductAccountant>();
            _warehouseService          = Resolve <IWarehouseService>();
            _warehouseInventoryService = Resolve <IWarehouseInventoryService>();
            _addressService            = Resolve <IAddressService>();
            _entityRoleService         = Resolve <IEntityRoleService>();

            var address = new Address()
            {
                CountryId   = 1,
                AddressType = AddressType.Home,
                Name        = "abc"
            };

            _addressService.Insert(address);
            _w1 = new Warehouse()
            {
                AddressId = address.Id
            };
            _w2 = new Warehouse()
            {
                AddressId = address.Id
            };
            _warehouseService.Insert(new[] { _w1, _w2 });
        }
Exemple #2
0
 public FashionProductContentController(IWarehouseInventoryService inventoryService, LocalizationService localizationService, ReadOnlyPricingLoader readOnlyPricingLoader, ICurrentMarket currentMarket)
 {
     _inventoryService      = inventoryService;
     _localizationService   = localizationService;
     _readOnlyPricingLoader = readOnlyPricingLoader;
     _currentMarket         = currentMarket;
 }
Exemple #3
0
 public ShipmentCapture(IPurchaseAccountant purchaseAccountant, IShipmentStatusHistoryService shipmentStatusHistoryService, IOrderFulfillmentService orderFulfillmentService, IWarehouseInventoryService warehouseInventoryService)
 {
     _purchaseAccountant           = purchaseAccountant;
     _shipmentStatusHistoryService = shipmentStatusHistoryService;
     _orderFulfillmentService      = orderFulfillmentService;
     _warehouseInventoryService    = warehouseInventoryService;
 }
Exemple #4
0
 public DigitalCameraVariationContentController(IWarehouseInventoryService warehouseInventoryService, LocalizationService localizationService, ReadOnlyPricingLoader readOnlyPricingLoader, ICurrentMarket currentMarket, IPriceDetailService priceDetailService)
 {
     _warehouseInventoryService = warehouseInventoryService;
     _localizationService       = localizationService;
     _readOnlyPricingLoader     = readOnlyPricingLoader;
     _currentMarket             = currentMarket;
     _priceDetailService        = priceDetailService;
 }
 public OrderAccountant(IWarehouseInventoryService warehouseInventoryService, IOrderFulfillmentService orderFulfillmentService, ITokenGenerator tokenGenerator, OrderSettings orderSettings, IOrderService orderService, IOrderItemService orderItemService, IPaymentProcessor paymentProcessor)
 {
     _warehouseInventoryService = warehouseInventoryService;
     _orderFulfillmentService   = orderFulfillmentService;
     _tokenGenerator            = tokenGenerator;
     _orderSettings             = orderSettings;
     _orderService     = orderService;
     _orderItemService = orderItemService;
     _paymentProcessor = paymentProcessor;
 }
 public FindHelper(ReadOnlyPricingLoader priceLoader, ILinksRepository linksRepository, IContentLoader contentLoader, UrlResolver urlResolver, IPermanentLinkMapper permanentLinkMapper, ReferenceConverter referenceConverter, IPriceService priceService, IWarehouseInventoryService inventoryService)
 {
     _priceLoader         = priceLoader;
     _linksRepository     = linksRepository;
     _contentLoader       = contentLoader;
     _urlResolver         = urlResolver;
     _permanentLinkMapper = permanentLinkMapper;
     _referenceConverter  = referenceConverter;
     _priceService        = priceService;
     _inventoryService    = inventoryService;
 }
 public PromotionEntryService(
     ILinksRepository linksRepository,
     ICatalogSystem catalogSystem,
     IContentLoader contentLoader,
     IWarehouseInventoryService inventoryService,
     IWarehouseRepository warehouseRepository)
 {
     _contentLoader = contentLoader;
     _linksRepository = linksRepository;
     _catalogSystem = catalogSystem;
     _inventoryService = inventoryService;
     _warehouseRepository = warehouseRepository;
 }
 public EntryImporter(IContentRepository contentRepository,
                      ReferenceConverter referenceConverter, IContentTypeRepository typeRepository,
                      ILogger logger, UrlResolver urlResolver,
                      IWarehouseRepository warehouseRepository,
                      IWarehouseInventoryService inventoryService,
                      IPriceService priceService)
     : base(contentRepository, referenceConverter, typeRepository, logger)
 {
     _urlResolver         = urlResolver;
     _warehouseRepository = warehouseRepository;
     _inventoryService    = inventoryService;
     _priceService        = priceService;
 }
Exemple #9
0
 public PromotionEntryService(
     ILinksRepository linksRepository,
     ICatalogSystem catalogSystem,
     IContentLoader contentLoader,
     IWarehouseInventoryService inventoryService,
     IWarehouseRepository warehouseRepository)
 {
     _contentLoader       = contentLoader;
     _linksRepository     = linksRepository;
     _catalogSystem       = catalogSystem;
     _inventoryService    = inventoryService;
     _warehouseRepository = warehouseRepository;
 }
 public EntryImporter(IContentRepository contentRepository,
     ReferenceConverter referenceConverter, IContentTypeRepository typeRepository,
     ILogger logger, UrlResolver urlResolver,
     IWarehouseRepository warehouseRepository,
     IWarehouseInventoryService inventoryService,
     IPriceService priceService)
     : base(contentRepository, referenceConverter, typeRepository, logger)
 {
     _urlResolver = urlResolver;
     _warehouseRepository = warehouseRepository;
     _inventoryService = inventoryService;
     _priceService = priceService;
 }
Exemple #11
0
 public CheckoutController(CustomerAddressRepository customerAddressRepository, IContentRepository contentRepository,
                           ICurrentMarket currentMarket, ICustomerFactory customerFactory,
                           LocalizationService localizationService,
                           IWarehouseInventoryService warehouseInventory,
                           IWarehouseRepository warehouseRepository,
                           PaymentRegistry paymentRegistry)
 {
     _customerAddressRepository = customerAddressRepository;
     _contactRepository         = new ContactRepository();
     _contentRepository         = contentRepository;
     _currentMarket             = currentMarket;
     _localizationService       = localizationService;
     _customerFactory           = customerFactory;
     _warehouseInventory        = warehouseInventory;
     _warehouseRepository       = warehouseRepository;
     _paymentRegistry           = paymentRegistry;
 }
Exemple #12
0
        protected void Setup()
        {
            _warehouseService               = Resolve <IWarehouseService>();
            _warehouseInventoryService      = Resolve <IWarehouseInventoryService>();
            _productService                 = Resolve <IProductService>();
            _orderAccountant                = Resolve <IOrderAccountant>();
            _productAttributeService        = Resolve <IProductAttributeService>();
            _availableAttributeService      = Resolve <IAvailableAttributeService>();
            _availableAttributeValueService = Resolve <IAvailableAttributeValueService>();
            _productVariantService          = Resolve <IProductVariantService>();
            _addressService                 = Resolve <IAddressService>();

            var address = new Address()
            {
                CountryId   = 1,
                AddressType = AddressType.Home,
                Name        = "abc"
            };

            _addressService.Insert(address);
            _w1 = new Warehouse()
            {
                AddressId = address.Id
            };
            _w2 = new Warehouse()
            {
                AddressId = address.Id
            };
            _warehouseService.Insert(_w1);
            _warehouseService.Insert(_w2);

            _sizeAvailableAttribute = new AvailableAttribute()
            {
                Name = "Size"
            };
            _colorAvailableAttribute = new AvailableAttribute()
            {
                Name = "Color"
            };
            var availableAttributes = new[]
            {
                _sizeAvailableAttribute, _colorAvailableAttribute
            };

            _availableAttributeService.Insert(availableAttributes);

            var attributeValues = new[]
            {
                new AvailableAttributeValue()
                {
                    AvailableAttributeId = _sizeAvailableAttribute.Id,
                    Value = "S"
                },
                new AvailableAttributeValue()
                {
                    AvailableAttributeId = _sizeAvailableAttribute.Id,
                    Value = "M"
                },
                new AvailableAttributeValue()
                {
                    AvailableAttributeId = _sizeAvailableAttribute.Id,
                    Value = "L"
                },
                new AvailableAttributeValue()
                {
                    AvailableAttributeId = _colorAvailableAttribute.Id,
                    Value = "Red"
                },
                new AvailableAttributeValue()
                {
                    AvailableAttributeId = _colorAvailableAttribute.Id,
                    Value = "Green"
                },
                new AvailableAttributeValue()
                {
                    AvailableAttributeId = _colorAvailableAttribute.Id,
                    Value = "Blue"
                },
            };

            _availableAttributeValueService.Insert(attributeValues);

            _p1 = new Product()
            {
                Name = "Microsoft Surface Pro",
                CanOrderWhenOutOfStock = true,
                ChargeTaxes            = true,
                ComparePrice           = 100,
                Price                 = 80,
                CreatedOn             = DateTime.UtcNow,
                UpdatedOn             = DateTime.UtcNow,
                IsShippable           = true,
                IsFeatured            = true,
                IsVisibleIndividually = true,
                DisplayOrder          = 1,
                Mpn            = "1",
                Gtin           = "2",
                Sku            = "SUR12",
                IsDownloadable = false,
                Description    =
                    "Surface Pro delivers even more speed and performance thanks to a powerful Intel® Core™ processor — with up to 50% more battery life1 than Surface Pro 4 and 2.5x more performance than Surface Pro 3.",
                Summary =
                    "Surface Pro delivers even more speed and performance thanks to a powerful Intel® Core™ processor — with up to 50% more battery life1 than Surface Pro 4 and 2.5x more performance than Surface Pro 3.",
                Published      = true,
                Deleted        = false,
                TrackInventory = true,
            };

            _p2 = new Product()
            {
                Name = "Microsoft Surface Pro",
                CanOrderWhenOutOfStock = true,
                ChargeTaxes            = true,
                ComparePrice           = 100,
                Price                 = 80,
                CreatedOn             = DateTime.UtcNow,
                UpdatedOn             = DateTime.UtcNow,
                IsShippable           = true,
                IsFeatured            = true,
                IsVisibleIndividually = true,
                DisplayOrder          = 1,
                Mpn            = "1",
                Gtin           = "2",
                Sku            = "SUR12",
                IsDownloadable = false,
                Description    =
                    "Surface Pro delivers even more speed and performance thanks to a powerful Intel® Core™ processor — with up to 50% more battery life1 than Surface Pro 4 and 2.5x more performance than Surface Pro 3.",
                Summary =
                    "Surface Pro delivers even more speed and performance thanks to a powerful Intel® Core™ processor — with up to 50% more battery life1 than Surface Pro 4 and 2.5x more performance than Surface Pro 3.",
                Published      = true,
                Deleted        = false,
                TrackInventory = true,
            };

            _productService.Insert(_p1);
            _productService.Insert(_p2);

            //link product attributes
            var productAttributeValuesSize = new List <ProductAttributeValue>()
            {
                new ProductAttributeValue()
                {
                    AvailableAttributeValueId = attributeValues[0].Id
                },
                new ProductAttributeValue()
                {
                    AvailableAttributeValueId = attributeValues[1].Id
                },
                new ProductAttributeValue()
                {
                    AvailableAttributeValueId = attributeValues[2].Id
                },
            };

            var productAttributeSize = new ProductAttribute()
            {
                AvailableAttributeId   = availableAttributes[0].Id,
                ProductId              = _p1.Id,
                ProductAttributeValues = productAttributeValuesSize
            };

            _productAttributeService.Insert(productAttributeSize);

            var productAttributeValuesColor = new List <ProductAttributeValue>()
            {
                new ProductAttributeValue()
                {
                    AvailableAttributeValueId = attributeValues[3].Id
                },
                new ProductAttributeValue()
                {
                    AvailableAttributeValueId = attributeValues[4].Id
                },
            };

            var productAttributeColor = new ProductAttribute()
            {
                AvailableAttributeId   = availableAttributes[1].Id,
                ProductId              = _p1.Id,
                ProductAttributeValues = productAttributeValuesColor
            };

            _productAttributeService.Insert(productAttributeColor);


            //generate variations
            // s + red
            var sRedVariant = _productVariantService.AddVariant(_p1, new ProductVariant()
            {
                ProductVariantAttributes = new List <ProductVariantAttribute>()
                {
                    new ProductVariantAttribute()
                    {
                        ProductAttributeId      = productAttributeSize.Id,
                        ProductAttributeValueId = productAttributeValuesSize[0].Id,
                    },
                    new ProductVariantAttribute()
                    {
                        ProductAttributeId      = productAttributeColor.Id,
                        ProductAttributeValueId = productAttributeValuesColor[0].Id
                    }
                },
                TrackInventory = true
            });

            _warehouseInventoryService.Insert(new WarehouseInventory()
            {
                ProductId        = _p1.Id,
                ProductVariantId = sRedVariant.Id,
                TotalQuantity    = 5,
                ReservedQuantity = 0,
                WarehouseId      = _w1.Id
            });
            // s + green
            var sGreenVariant = _productVariantService.AddVariant(_p1, new ProductVariant()
            {
                ProductVariantAttributes = new List <ProductVariantAttribute>()
                {
                    new ProductVariantAttribute()
                    {
                        ProductAttributeId      = productAttributeSize.Id,
                        ProductAttributeValueId = productAttributeValuesSize[0].Id
                    },
                    new ProductVariantAttribute()
                    {
                        ProductAttributeId      = productAttributeColor.Id,
                        ProductAttributeValueId = productAttributeValuesColor[1].Id
                    }
                },
                TrackInventory = false
            });

            _warehouseInventoryService.Insert(new WarehouseInventory()
            {
                ProductId        = _p1.Id,
                ProductVariantId = sGreenVariant.Id,
                TotalQuantity    = 5,
                ReservedQuantity = 0,
                WarehouseId      = _w1.Id
            });

            // m + red
            var mRedVariant = _productVariantService.AddVariant(_p1, new ProductVariant()
            {
                ProductVariantAttributes = new List <ProductVariantAttribute>()
                {
                    new ProductVariantAttribute()
                    {
                        ProductAttributeId      = productAttributeSize.Id,
                        ProductAttributeValueId = productAttributeValuesSize[1].Id
                    },
                    new ProductVariantAttribute()
                    {
                        ProductAttributeId      = productAttributeColor.Id,
                        ProductAttributeValueId = productAttributeValuesColor[0].Id
                    }
                },
                TrackInventory = true
            });

            _warehouseInventoryService.Insert(new WarehouseInventory()
            {
                ProductId        = _p1.Id,
                ProductVariantId = mRedVariant.Id,
                TotalQuantity    = 0,
                ReservedQuantity = 0,
                WarehouseId      = _w1.Id
            });

            _warehouseInventoryService.Insert(new WarehouseInventory()
            {
                ProductId        = _p2.Id,
                WarehouseId      = _w1.Id,
                ReservedQuantity = 1,
                TotalQuantity    = 1
            });
            _warehouseInventoryService.Insert(new WarehouseInventory()
            {
                ProductId        = _p2.Id,
                WarehouseId      = _w2.Id,
                ReservedQuantity = 1,
                TotalQuantity    = 2
            });

            _o1 = new Order()
            {
                Id         = 1,
                OrderItems = new List <OrderItem>()
                {
                    new OrderItem()
                    {
                        OrderId          = 1,
                        ProductId        = _p1.Id,
                        ProductVariantId = sRedVariant.Id,
                        Quantity         = 2,
                        Id = 1
                    },
                    new OrderItem()
                    {
                        OrderId          = 1,
                        ProductId        = _p1.Id,
                        ProductVariantId = sGreenVariant.Id,
                        Quantity         = 1,
                        Id = 2
                    }
                }
            };

            _o2 = new Order()
            {
                Id         = 2,
                OrderItems = new List <OrderItem>()
                {
                    new OrderItem()
                    {
                        OrderId   = 2,
                        ProductId = _p2.Id,
                        Quantity  = 1,
                        Id        = 3
                    }
                }
            };

            _o3 = new Order()
            {
                Id         = 3,
                OrderItems = new List <OrderItem>()
                {
                    new OrderItem()
                    {
                        OrderId   = 2,
                        ProductId = _p2.Id,
                        Quantity  = 3,
                        Id        = 4
                    }
                }
            };

            _o4 = new Order()
            {
                Id         = 4,
                OrderItems = new List <OrderItem>()
                {
                    new OrderItem()
                    {
                        OrderId          = 1,
                        ProductId        = _p1.Id,
                        ProductVariantId = sRedVariant.Id,
                        Quantity         = 2,
                        Id = 5
                    },
                    new OrderItem()
                    {
                        OrderId          = 1,
                        ProductId        = _p1.Id,
                        ProductVariantId = sGreenVariant.Id,
                        Quantity         = 1,
                        Id = 6
                    },
                    new OrderItem()
                    {
                        OrderId   = 2,
                        ProductId = _p2.Id,
                        Quantity  = 1,
                        Id        = 7
                    }
                }
            };
        }
Exemple #13
0
 public WarehouseInventoryController(IWarehouseInventoryService service) : base(service)
 {
     _service = service;
 }