Automation and Shopify library updates
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PartSource.Automation.Jobs.POC
|
||||
@@ -19,7 +20,7 @@ namespace PartSource.Automation.Jobs.POC
|
||||
_shopifyClient = shopifyClient;
|
||||
}
|
||||
|
||||
public async Task Run()
|
||||
public async Task Run(CancellationToken token, params string[] arguments)
|
||||
{
|
||||
IEnumerable<Product> products = await _shopifyClient.Products.Get(new Dictionary<string, object> { { "limit", 250 }, { "product_type", "CA112-SC137-FL13750_Intake Manifolds" } });
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
@@ -29,7 +30,7 @@ namespace PartSource.Automation.Jobs.POC
|
||||
_shopifyClient = shopifyClient;
|
||||
}
|
||||
|
||||
public async Task Run()
|
||||
public async Task Run(CancellationToken token, params string[] arguments)
|
||||
{
|
||||
await BuildDatabase();
|
||||
await UpdateShopify();
|
||||
@@ -177,7 +178,7 @@ namespace PartSource.Automation.Jobs.POC
|
||||
Namespace = "position",
|
||||
Key = key,
|
||||
Value = json,
|
||||
ValueType = "json_string",
|
||||
Type = "json",
|
||||
OwnerResource = "product",
|
||||
OwnerId = product.Id
|
||||
};
|
||||
|
||||
@@ -16,6 +16,7 @@ using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PartSource.Automation.Jobs
|
||||
@@ -37,7 +38,7 @@ namespace PartSource.Automation.Jobs
|
||||
_vehicleService = vehicleService;
|
||||
}
|
||||
|
||||
public async Task Run()
|
||||
public async Task Run(CancellationToken token, params string[] arguments)
|
||||
{
|
||||
|
||||
IEnumerable<Product> products = null;
|
||||
|
||||
@@ -18,6 +18,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PartSource.Automation.Jobs.POC
|
||||
@@ -39,7 +40,7 @@ namespace PartSource.Automation.Jobs.POC
|
||||
_vehicleService = vehicleService;
|
||||
}
|
||||
|
||||
public async Task Run()
|
||||
public async Task Run(CancellationToken token, params string[] arguments)
|
||||
{
|
||||
IList<string> productTypes = new List<string>
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
@@ -29,9 +30,9 @@ namespace PartSource.Automation.Jobs.POC
|
||||
_shopifyClient = shopifyClient;
|
||||
}
|
||||
|
||||
public async Task Run()
|
||||
public async Task Run(CancellationToken token, params string[] arguments)
|
||||
{
|
||||
// await BuildDatabase();
|
||||
await BuildDatabase();
|
||||
await UpdateShopify();
|
||||
}
|
||||
|
||||
@@ -143,7 +144,6 @@ namespace PartSource.Automation.Jobs.POC
|
||||
}
|
||||
}
|
||||
|
||||
//[SuppressMessage("Globalization", "CA1308:Normalize strings to uppercase", Justification = "It's a Shopify metafield key")]
|
||||
private async Task SavePositionMetafield(Product product, IList<int> vehicleIds, string position)
|
||||
{
|
||||
if (vehicleIds.Count == 0)
|
||||
@@ -169,7 +169,7 @@ namespace PartSource.Automation.Jobs.POC
|
||||
Namespace = "position",
|
||||
Key = key,
|
||||
Value = json,
|
||||
ValueType = "json_string",
|
||||
Type = "json",
|
||||
OwnerResource = "product",
|
||||
OwnerId = product.Id
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user