public CallMessagesResult <bool> UpdateFeed(ILogService log, ITime time, IDbFactory dbFactory, ISystemActionService actionService, IItemHistoryService itemHistoryService, long companyId) { var sourceFeed = Path.Combine(UrlHelper.GetImportCatalogFeedPath(), FileName); var marketplaceManager = new MarketplaceKeeper(dbFactory, false); marketplaceManager.Init(); IWalmartApi api = (IWalmartApi) new MarketFactory(marketplaceManager.GetAll(), time, log, dbFactory, null) .GetApi(companyId, MarketType.WalmartCA, null); var service = new WalmartListingInfoReader(log, time, api, dbFactory, actionService, itemHistoryService, null, null); service.UpdateListingInfo(sourceFeed); return(new CallMessagesResult <bool>() { Data = true }); }
protected override void RunCallback() { var dbFactory = new DbFactory(); var time = new TimeService(dbFactory); var log = GetLogger(); var settings = new SettingsService(dbFactory); var systemAction = new SystemActionService(log, time); var itemHistoryService = new ItemHistoryService(log, time, dbFactory); var lastSyncDate = settings.GetListingsReadDate(_api.Market, _api.MarketplaceId); LogWrite("Last sync date=" + lastSyncDate); var walmartReader = new WalmartListingInfoReader(GetLogger(), time, _api, dbFactory, systemAction, itemHistoryService, AppSettings.WalmartReportBaseDirectory, AppSettings.WalmartFeedBaseDirectory); if (!lastSyncDate.HasValue || (time.GetUtcTime() - lastSyncDate) > _betweenProcessingInverval) { walmartReader.UpdateListingInfo(); walmartReader.ReadListingInventory(); walmartReader.ResetQtyForNotExistListings(); walmartReader.RetireNotExistListings(); settings.SetListingsReadDate(time.GetUtcTime(), _api.Market, _api.MarketplaceId); } }
public void ResetNotExistListingQty(IWalmartApi api, string overrideReportPath) { var service = new WalmartListingInfoReader(_log, _time, api, _dbFactory, _actionService, _itemHistoryService, AppSettings.WalmartReportBaseDirectory, AppSettings.WalmartFeedBaseDirectory); service.ResetQtyForNotExistListings(overrideReportPath); }
public void UpdateListingInfo(WalmartCAApi api, string reportPath) { var service = new WalmartListingInfoReader(_log, _time, api, _dbFactory, _actionService, _itemHistoryService, AppSettings.WalmartReportBaseDirectory, AppSettings.WalmartFeedBaseDirectory); service.UpdateListingInfo(reportPath); }
public void FindSecondDayFlagDisparity(IWalmartApi api, string overrideFeedpath) { var service = new WalmartListingInfoReader(_log, _time, api, _dbFactory, _actionService, _itemHistoryService, AppSettings.WalmartReportBaseDirectory, AppSettings.WalmartFeedBaseDirectory); service.FindSecondDayFlagDisparity(overrideFeedpath); }
public void RetireNotExistListings(IWalmartApi api) { var service = new WalmartListingInfoReader(_log, _time, api, _dbFactory, _actionService, _itemHistoryService, AppSettings.WalmartReportBaseDirectory, AppSettings.WalmartFeedBaseDirectory); service.RetireNotExistListings(); }