Import products
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Text.Json;
|
||||
using Bimix.Domain.Entities;
|
||||
using Bimix.Infrastructure.Data;
|
||||
@@ -28,6 +29,9 @@ public class ProductSyncService(HttpClient httpClient, BimixDbContext db, IConfi
|
||||
{
|
||||
var idStr = p.GetProperty("id").GetString() ?? "";
|
||||
var name = p.GetProperty("name").GetString() ?? "";
|
||||
var code = p.GetProperty("code").GetString() ?? "";
|
||||
var stockAddresses = p.GetProperty("stock_addresses").GetString() ?? "";
|
||||
var ean = p.GetProperty("ean").GetString() ?? "";
|
||||
|
||||
if (!Guid.TryParse(idStr, out Guid id))
|
||||
{
|
||||
@@ -43,6 +47,9 @@ public class ProductSyncService(HttpClient httpClient, BimixDbContext db, IConfi
|
||||
{
|
||||
Id = id,
|
||||
Name = name,
|
||||
Ean = ean,
|
||||
Code = code,
|
||||
StockAddresses = stockAddresses,
|
||||
CreatedAt = DateTime.UtcNow,
|
||||
UpdatedAt = DateTime.UtcNow
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user