Fitment related changes

This commit is contained in:
2023-03-12 15:51:54 -04:00
parent ff20615481
commit c9e956d004
5 changed files with 18 additions and 14 deletions

View File

@@ -52,7 +52,7 @@ namespace PartSource.Automation.Jobs.POC
{
BaseVehicleId = baseVehicleId
},
MfrCode = new[] { "BOS", "TRI" },
MfrCode = new[] { "CSD" },
PartType = new[] { new PartType { Id = 8852 } },
Criterion = new[]
{

View File

@@ -44,7 +44,7 @@ namespace PartSource.Automation.Jobs
public async Task Run(CancellationToken token, params string[] arguments)
{
_whiSeoService.TruncateFitmentTables();
// _whiSeoService.GetFiles(_seoDataType);
_whiSeoService.GetFiles(_seoDataType);
string directory = Path.Combine(_ftpConfiguration.Destination, _seoDataType.ToString().ToLowerInvariant());
DirectoryInfo directoryInfo = new DirectoryInfo(directory);
@@ -96,9 +96,9 @@ namespace PartSource.Automation.Jobs
Task.WaitAll(taskArray);
_whiSeoService.CreateFitmentView();
// _whiSeoService.CreateFitmentView();
_whiSeoService.SaveNotes(_noteDictionary);
//_whiSeoService.SaveNotes(_noteDictionary);
}
public string Decompress(FileInfo fileInfo)

View File

@@ -40,7 +40,7 @@ namespace PartSource.Automation.Jobs
public async Task Run(CancellationToken token, params string[] arguments)
{
_whiSeoService.TruncateVehicleTable();
// _whiSeoService.GetFiles(_seoDataType);
_whiSeoService.GetFiles(_seoDataType);
string directory = Path.Combine(_ftpConfiguration.Destination, _seoDataType.ToString().ToLowerInvariant());
DirectoryInfo directoryInfo = new DirectoryInfo(directory);

View File

@@ -40,7 +40,11 @@ namespace PartSource.Automation.Jobs
try
{
products = await _shopifyClient.Products.Get(new Dictionary<string, object> { { "limit", 250 } });
products = await _shopifyClient.Products.Get(new Dictionary<string, object> { { "limit", 250 }, { "product_type", "CA111-SC250-FL25049_Entry Ball Joints" } });
//products = new List<Product>
//{
// await _shopifyClient.Products.GetById(4388919574575)
//};
}
catch (Exception ex)
@@ -62,8 +66,8 @@ namespace PartSource.Automation.Jobs
IEnumerable<Metafield> metafields = await _shopifyClient.Metafields.Get(new Dictionary<string, object> { { "metafield[owner_id]", product.Id }, { "metafield[owner_resource]", "product" } });
importData = new ImportData
{
LineCode = metafields.FirstOrDefault(m => m.Key == "custom_label_0").Value ?? string.Empty,
PartNumber = metafields.FirstOrDefault(m => m.Key == "custom_label_1").Value ?? string.Empty,
LineCode = metafields.FirstOrDefault(m => m.Key == "custom_label_0")?.Value ?? string.Empty,
PartNumber = metafields.FirstOrDefault(m => m.Key == "custom_label_1")?.Value ?? string.Empty,
VariantSku = product.Variants[0].Sku // They know we can't do fitment for variants
};

View File

@@ -100,7 +100,7 @@ namespace PartSource.Automation
// //.StartsAt(DateTime.Today.AddHours(25))
// )
.HasJob<UpdatePricing>(options => options.HasInterval(new TimeSpan(24, 0, 0))
.HasJob<UpdateFitment>(options => options.HasInterval(new TimeSpan(24, 0, 0))
//.HasDependency<ExecuteSsisPackages>()
// .StartsAt(DateTime.Today.AddHours(28))
);