diff --git a/BrickOwlSharp.Client/Inventory.cs b/BrickOwlSharp.Client/Inventory.cs index 4a803c5..f2f9eab 100644 --- a/BrickOwlSharp.Client/Inventory.cs +++ b/BrickOwlSharp.Client/Inventory.cs @@ -87,8 +87,8 @@ public class Inventory [JsonPropertyName("reserve_uid"), JsonConverter(typeof(IntStringConverter))] public int? ReserveUid { get; set; } - [JsonPropertyName("type")] - public string Type{ get; set; } + [JsonPropertyName("type"), JsonConverter(typeof(ItemTypeStringConverter))] + public ItemType Type { get; set; } [JsonPropertyName("tier_price"), JsonConverter(typeof(TierPriceListConverter))] public List TierPrices { get; set; } diff --git a/BrickOwlSharp.Client/OrderItem.cs b/BrickOwlSharp.Client/OrderItem.cs index 1e79734..58203e9 100644 --- a/BrickOwlSharp.Client/OrderItem.cs +++ b/BrickOwlSharp.Client/OrderItem.cs @@ -39,8 +39,8 @@ public class OrderItem [JsonPropertyName("name")] public string Name { get; set; } - [JsonPropertyName("type")] - public string Type { get; set; } + [JsonPropertyName("type"), JsonConverter(typeof(ItemTypeStringConverter))] + public ItemType Type { get; set; } [JsonPropertyName("color_name")] public string Color_Name { get; set; } diff --git a/BrickOwlSharp.Demos/BrickOwlSharp.Demos.csproj b/BrickOwlSharp.Demos/BrickOwlSharp.Demos.csproj index 3d8f80d..42571f1 100644 --- a/BrickOwlSharp.Demos/BrickOwlSharp.Demos.csproj +++ b/BrickOwlSharp.Demos/BrickOwlSharp.Demos.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 enable enable diff --git a/BrickOwlSharp.Demos/InventoryDemo.cs b/BrickOwlSharp.Demos/InventoryDemo.cs index dd8f7d0..b191885 100644 --- a/BrickOwlSharp.Demos/InventoryDemo.cs +++ b/BrickOwlSharp.Demos/InventoryDemo.cs @@ -44,21 +44,19 @@ internal async Task RunAsync() Quantity = 1, Price = 1000.15m // make sure nobody will ever buy it :) }); - - /* + bool updateResult = await client.UpdateInventoryAsync(new UpdateInventory() { - LotId = 107931517, + LotId = newInventoryResult.LotId.Value, AbsoluteQuantity = 23 }); - */ foreach (Inventory inventory in await client.GetInventoryAsync()) { - Console.WriteLine($"{inventory.Id}: quantity {inventory.Quantity}, lot id: {inventory.LotId}"); + Console.WriteLine($"{inventory.Id}: quantity {inventory.Quantity}, lot id: {inventory.LotId}, type: {inventory.Type}"); } - bool result = await client.DeleteInventoryAsync(new DeleteInventory() { LotId = 107931627 }); + bool result = await client.DeleteInventoryAsync(new DeleteInventory() { LotId = newInventoryResult.LotId.Value }); } } }