Skip to content

Commit 9553825

Browse files
authored
Merge pull request #169 from commercetools/nullable_restockable
fix type for restockableInDays
2 parents 52108cf + be65e7b commit 9553825

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

commercetools.Sdk/IntegrationTests/commercetools.Sdk.IntegrationTests/Inventory/InventoryIntegrationTests.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,13 @@ await WithUpdateableInventoryEntry(client, DefaultInventoryEntryDraft,
166166

167167

168168
Assert.Equal(restockableInDays, updatedInventoryEntry.RestockableInDays);
169-
return updatedInventoryEntry;
169+
170+
SetRestockableInDaysUpdateAction action2 = new SetRestockableInDaysUpdateAction();
171+
var updatedInventoryEntry2 = await client
172+
.ExecuteAsync(updatedInventoryEntry.UpdateById(actions => actions.AddUpdate(action2)));
173+
Assert.Null(updatedInventoryEntry2.RestockableInDays);
174+
175+
return updatedInventoryEntry2;
170176
});
171177
}
172178

commercetools.Sdk/commercetools.Sdk.Domain/InventoryEntries/InventoryEntry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class InventoryEntry : Resource<InventoryEntry>
1212
public Reference<Channel> SupplyChannel { get; set; }
1313
public long QuantityOnStock { get; set; }
1414
public long AvailableQuantity { get; set; }
15-
public int RestockableInDays { get; set; }
15+
public int? RestockableInDays { get; set; }
1616
public DateTime? ExpectedDelivery { get; set; }
1717
public CustomFields Custom { get; set; }
1818
}

commercetools.Sdk/commercetools.Sdk.Domain/InventoryEntries/InventoryEntryDraft.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class InventoryEntryDraft : IDraft<InventoryEntry>
1111
public string Sku { get; set; }
1212
public IReference<Channel> SupplyChannel { get; set; }
1313
public long QuantityOnStock { get; set; }
14-
public int RestockableInDays { get; set; }
14+
public int? RestockableInDays { get; set; }
1515
public DateTime? ExpectedDelivery { get; set; }
1616
public CustomFieldsDraft Custom { get; set; }
1717
}

commercetools.Sdk/commercetools.Sdk.Domain/InventoryEntries/UpdateActions/SetRestockableInDaysUpdateAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
public class SetRestockableInDaysUpdateAction : UpdateAction<InventoryEntry>
44
{
55
public string Action => "setRestockableInDays";
6-
public int RestockableInDays { get; set; }
6+
public int? RestockableInDays { get; set; }
77
}
88
}

0 commit comments

Comments
 (0)