Example #1
0
        public void SubmitTestPriceFeed(WalmartCAApi api)
        {
            var item1 = new ItemDTO()
            {
                StyleId      = 1158,
                SKU          = "21TE062ERDZA-1-3T", // "21TE062ERDZA-1-3T",
                CurrentPrice = 19.89M
            };

            using (var db = _dbFactory.GetRWDb())
            {
                if (item1.StyleId.HasValue)
                {
                    var itemStyle = db.StyleFeatureValues.GetFeatureValueByStyleIdByFeatureId(
                        item1.StyleId.Value,
                        StyleFeatureHelper.ITEMSTYLE);

                    if (!item1.ListPrice.HasValue && itemStyle != null)
                    {
                        item1.ListPrice = PriceHelper.GetDefaultMSRP(itemStyle.Value);
                    }
                }
            }

            //var result = api.GetFeed("20F17E0B509143B89023AD9B8036D158@AQYBAQA");
            //_log.Info(result.ToString());

            //var result = api.SendPrice(item1);
            //_log.Info(result.ToString());

            api.SubmitPriceFeed("1", new List <ItemDTO>()
            {
                item1
            }, AppSettings.WalmartFeedBaseDirectory);
        }
Example #2
0
        public void GetFeedList(WalmartCAApi api)
        {
            var feeds      = api.GetFeeds();
            var lastFeedId = feeds.First().AmazonIdentifier;
            var feedItems  = api.GetFeedItems(lastFeedId);

            _log.Info(feedItems.ToString());
        }
Example #3
0
        public void GetInventory(WalmartCAApi api)
        {
            var sku = "17CI000XDSZA-";

            var result = api.GetInventory(sku);

            _log.Info(result.ToString());
        }
Example #4
0
        public void GetFeedItems(WalmartCAApi api)
        {
            var feedItems = api.GetFeedItems("1725915FF4EF4616AB097CDA1D2908D6@AQkBAAA");
            var item1     = feedItems.Data.FirstOrDefault(i => i.ItemId == "K182277PP-3T");
            var item2     = feedItems.Data.FirstOrDefault(i => i.ItemId == "K182277PP-4T");

            _log.Info(item1.Status);
            _log.Info(item2.Status);
            _log.Info(feedItems.ToString());
        }
Example #5
0
        public void ResetNotExistListingQty(WalmartCAApi api, string reportPath)
        {
            var service = new WalmartListingInfoReader(_log, _time, api, _dbFactory,
                                                       _actionService,
                                                       _itemHistoryService,
                                                       AppSettings.WalmartReportBaseDirectory,
                                                       AppSettings.WalmartFeedBaseDirectory);

            service.ResetQtyForNotExistListings(reportPath);
        }
Example #6
0
        public void UpdateListingInfo(WalmartCAApi api, string reportPath)
        {
            var service = new WalmartListingInfoReader(_log, _time, api, _dbFactory,
                                                       _actionService,
                                                       _itemHistoryService,
                                                       AppSettings.WalmartReportBaseDirectory,
                                                       AppSettings.WalmartFeedBaseDirectory);

            service.UpdateListingInfo(reportPath);
        }
Example #7
0
        public void SubmitPriceFeed(WalmartCAApi api, IList <string> skuList)
        {
            var feed = new WalmartPriceFeedByOne(_log, _time, api, _dbFactory,
                                                 AppSettings.WalmartFeedBaseDirectory);

            //using (var db = _dbFactory.GetRWDb())
            //{
            //    skuList =
            //        db.Items.GetAll().Where(i => i.Market == (int) MarketType.WalmartCA).Select(i => i.ASIN).ToList();
            //}
            feed.SubmitFeed(skuList);
        }
Example #8
0
        public void SubmitTestInventoryFeed(WalmartCAApi api)
        {
            var item1 = new ItemDTO()
            {
                SKU          = "K182834PP-3T",
                RealQuantity = 5,
            };

            api.SubmitInventoryFeed("1", new List <ItemDTO>()
            {
                item1
            }, AppSettings.WalmartFeedBaseDirectory);
        }
Example #9
0
        public void SubmitInventoryFeed(WalmartCAApi api)
        {
            var feed = new WalmartInventoryFeed(_log, _time, api, _dbFactory, AppSettings.WalmartFeedBaseDirectory);

            var steps = new StepSleeper(TimeSpan.FromMinutes(5), 1);

            var feedDto = feed.CheckFeedStatus(TimeSpan.Zero);

            if (feedDto == null)
            {
                feed.SubmitFeed();
            }

            //steps.NextStep();
        }
Example #10
0
        public void RetireUnpublishedItems(WalmartCAApi api)
        {
            using (var db = _dbFactory.GetRWDb())
            {
                var items = db.Items.GetAllViewAsDto().Where(i => i.Market == (int)MarketType.WalmartCA &&
                                                             i.PublishedStatus == (int)PublishedStatuses.HasUnpublishRequest)
                            .ToList();

                foreach (var item in items)
                {
                    var result = api.RetireItem(item.SKU);
                    if (result.IsSuccess)
                    {
                        _log.Info("SKU was unpublished=" + item.SKU);
                        var dbItem = db.Items.Get(item.Id);
                        dbItem.ItemPublishedStatus = (int)PublishedStatuses.Unpublished;
                        db.Commit();
                    }
                }
            }
        }
Example #11
0
        public void GetOrders(WalmartCAApi api, string orderId)
        {
            IList <DTOOrder> orders;

            if (!String.IsNullOrEmpty(orderId))
            {
                orders = new List <DTOOrder>()
                {
                    api.GetOrder(_log, orderId)
                }
            }
            ;
            else
            {
                orders = api.GetOrders(_log, _time.GetAppNowTime().AddDays(-5), null).ToList();
            }
            var order = orders.FirstOrDefault(o => o.MarketOrderId == orderId);

            _log.Info(order.ToString());
            _log.Info(orders.ToString());
        }
Example #12
0
        public CallWalmartCAProcessing(ILogService log,
                                       ITime time,
                                       ICacheService cacheService,
                                       IDbFactory dbFactory,
                                       IEmailService emailService,
                                       WalmartCAApi walmartCAApi,
                                       CompanyDTO company)
        {
            _log          = log;
            _time         = time;
            _dbFactory    = dbFactory;
            _cacheService = cacheService;
            _walmartCAApi = walmartCAApi;
            _company      = company;
            _emailService = emailService;

            var itemHistoryService = new ItemHistoryService(_log, _time, _dbFactory);

            _actionService            = new SystemActionService(_log, _time);
            _htmlScraper              = new HtmlScraperService(log, time, dbFactory);
            _barcodeService           = new BarcodeService(log, time, dbFactory);
            _autoCreateListingService = new AutoCreateWalmartCAListingService(log, time, dbFactory, _cacheService, _barcodeService, _emailService, itemHistoryService, AppSettings.IsDebug);
        }
Example #13
0
        public void SubmitItemsFeed(WalmartCAApi api, List <string> asinList, PublishedStatuses overrideItemStatus)
        {
            var feed = new WalmartItemsFeed(_log,
                                            _time,
                                            api,
                                            _dbFactory,
                                            AppSettings.WalmartFeedBaseDirectory,
                                            AppSettings.SwatchImageDirectory,
                                            AppSettings.SwatchImageBaseUrl,
                                            AppSettings.WalmartImageDirectory,
                                            AppSettings.WalmartImageBaseUrl);

            var steps = new StepSleeper(TimeSpan.FromMinutes(5), 1);

            var feedDto = feed.CheckFeedStatus(TimeSpan.Zero);

            if (feedDto == null)
            {
                feed.SubmitFeed(asinList, overrideItemStatus);
            }

            //steps.NextStep();
        }
Example #14
0
 public void GetItemBySKU(WalmartCAApi api)
 {
     api.GetItemBySKU("US213-3T");
 }
Example #15
0
 public void GetAllItems(WalmartCAApi api)
 {
     api.GetAllItems();
 }
Example #16
0
        public void GetFeed(WalmartCAApi api, string feedId)
        {
            var feed = api.GetFeed(feedId);

            _log.Info(feed.ToString());
        }