Skip to content

Commit ad6317f

Browse files
committed
Removed default value handling option
Added nullable types on bool and int on entities
1 parent 8463830 commit ad6317f

File tree

6 files changed

+78
-76
lines changed

6 files changed

+78
-76
lines changed

NetoDotNET.Examples/Program.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static void Main(string[] args)
4040
//GetItems(neto);
4141
//GetItemsFromDate(neto);
4242

43-
//AddItems(neto);
43+
AddItems(neto);
4444
//AddVariableItems(neto);
4545

4646
//UpdateItems(neto);
@@ -749,7 +749,7 @@ static void UpdateItems(StoreManager neto)
749749
case Ack.Success:
750750
foreach (var i in result.Item)
751751
{
752-
Console.WriteLine($"Updated ID:{i.InventoryID} SKU: {i.SKU} at {result.CurrentTime}");
752+
Console.WriteLine($"Updated SKU: {i.SKU} at {result.CurrentTime}");
753753
}
754754
break;
755755

@@ -767,9 +767,11 @@ static void AddItems(StoreManager neto)
767767
{
768768
Item[] item = new Item[] {
769769
new Item {
770-
Name = "My New Item",
771-
SKU = "1234",
772-
DefaultPrice = 1.00m
770+
Name = "Price test",
771+
SKU = "1111",
772+
DefaultPrice = 1.00m,
773+
IsActive = false,
774+
Approved = false
773775
}
774776
};
775777

NetoDotNET/Entities/Customer/Customer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class Customer
5050

5151
public string WebsiteURL { get; set; }
5252

53-
public decimal CreditLimit { get; set; }
53+
public decimal? CreditLimit { get; set; }
5454

5555
public string DefaultInvoiceTerms { get; set; }
5656

NetoDotNET/Entities/Order/Order.cs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ public class Order
3232

3333
public bool TaxInclusive { get; set; }
3434

35-
public decimal OrderTax { get; set; }
35+
public decimal? OrderTax { get; set; }
3636

37-
public decimal SurchargeTotal { get; set; }
37+
public decimal? SurchargeTotal { get; set; }
3838

39-
public decimal SurchargeTaxable { get; set; }
39+
public decimal? SurchargeTaxable { get; set; }
4040

41-
public decimal ShippingTotal { get; set; }
41+
public decimal? ShippingTotal { get; set; }
4242

43-
public decimal ShippingTax { get; set; }
43+
public decimal? ShippingTax { get; set; }
4444

45-
public decimal ShippingDiscount { get; set; }
45+
public decimal? ShippingDiscount { get; set; }
4646

4747
[JsonConverter(typeof(NetoDateNullConverter<DateTime>))]
4848
public DateTime? DateRequired { get; set; }
@@ -143,13 +143,13 @@ public class Order
143143

144144
public string BillFax { get; set; }
145145

146-
public decimal ProductSubtotal { get; set; }
146+
public decimal? ProductSubtotal { get; set; }
147147

148148
public string PurchaseOrderNumber { get; set; }
149149

150150
public string CouponCode { get; set; }
151151

152-
public decimal CouponDiscount { get; set; }
152+
public decimal? CouponDiscount { get; set; }
153153

154154
public string CompleteStatus { get; set; }
155155

@@ -178,9 +178,9 @@ public class OrderLine
178178

179179
public int BackorderQuantity { get; set; }
180180

181-
public decimal UnitPrice { get; set; }
181+
public decimal? UnitPrice { get; set; }
182182

183-
public decimal Tax { get; set; }
183+
public decimal? Tax { get; set; }
184184

185185
public string TaxCode { get; set; }
186186

@@ -190,21 +190,21 @@ public class OrderLine
190190

191191
public string WarehouseReference { get; set; }
192192

193-
public decimal PercentDiscount { get; set; }
193+
public decimal? PercentDiscount { get; set; }
194194

195-
public decimal ProductDiscount { get; set; }
195+
public decimal? ProductDiscount { get; set; }
196196

197-
public decimal CostPrice { get; set; }
197+
public decimal? CostPrice { get; set; }
198198

199199
public string ShippingMethod { get; set; }
200200

201201
public string ShippingTracking { get; set; }
202202

203-
public decimal Shipping { get; set; }
203+
public decimal? Shipping { get; set; }
204204

205-
public decimal Weight { get; set; }
205+
public decimal? Weight { get; set; }
206206

207-
public decimal Cubic { get; set; }
207+
public decimal? Cubic { get; set; }
208208

209209
public string Extra { get; set; }
210210

@@ -215,7 +215,7 @@ public class OrderLine
215215

216216
public int QuantityShipped { get; set; }
217217

218-
public decimal CouponDiscount { get; set; }
218+
public decimal? CouponDiscount { get; set; }
219219

220220
public OrderLineEBay eBay { get; set; }
221221
}
@@ -229,7 +229,7 @@ public class ExtraOptions
229229
public class OrderPayment
230230
{
231231
public string OrderPaymentID { get; set; }
232-
public decimal OrderPaymentAmount { get; set; }
232+
public decimal? OrderPaymentAmount { get; set; }
233233
public string PaymentType { get; set; }
234234
}
235235

@@ -426,15 +426,15 @@ public class AddOrder
426426

427427
public string ShippingMethod { get; set; }
428428

429-
public decimal ShippingCost { get; set; }
429+
public decimal? ShippingCost { get; set; }
430430

431431
public bool SignatureRequired { get; set; }
432432

433433
public string CurrencyCode { get; set; }
434434

435435
public AddOrderLine[] orderLine { get; set; }
436436

437-
public decimal OrderRounding { get; set; }
437+
public decimal? OrderRounding { get; set; }
438438

439439
}
440440

@@ -460,19 +460,19 @@ public class AddOrderLine
460460

461461
public string Quantity { get; set; }
462462

463-
public decimal UnitPrice { get; set; }
463+
public decimal? UnitPrice { get; set; }
464464

465-
public decimal UnitCost { get; set; }
465+
public decimal? UnitCost { get; set; }
466466

467-
public decimal ShippingWeight { get; set; }
467+
public decimal? ShippingWeight { get; set; }
468468

469469
public string QuantityShipped { get; set; }
470470

471-
public decimal DiscountPercent { get; set; }
471+
public decimal? DiscountPercent { get; set; }
472472

473-
public decimal DiscountAmount { get; set; }
473+
public decimal? DiscountAmount { get; set; }
474474

475-
public decimal Cubic { get; set; }
475+
public decimal? Cubic { get; set; }
476476

477477
public OrderLineKitComponents[] kitComponents { get; set; }
478478

@@ -485,7 +485,7 @@ public class OrderLineKitComponents
485485
{
486486
public string ComponentSKU { get; set; }
487487

488-
public decimal ComponentValue { get; set; }
488+
public decimal? ComponentValue { get; set; }
489489

490490
public string AssembleQuantity { get; set; }
491491

NetoDotNET/Entities/Product/Item.cs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public class Item
1515

1616
public string SKU { get; set; }
1717

18-
public int InventoryID { get; set; }
18+
public int? InventoryID { get; set; }
1919

2020
public string ParentSKU { get; set; }
2121

2222
public string AccountingCode { get; set; }
2323

24-
public bool Virtual { get; set; }
24+
public bool? Virtual { get; set; }
2525

2626
public string Brand { get; set; }
2727

@@ -33,11 +33,11 @@ public class Item
3333

3434
public string SortOrder2 { get; set; }
3535

36-
public decimal RRP { get; set; }
36+
public decimal? RRP { get; set; }
3737

38-
public decimal DefaultPrice { get; set; }
38+
public decimal? DefaultPrice { get; set; }
3939

40-
public decimal PromotionPrice { get; set; }
40+
public decimal? PromotionPrice { get; set; }
4141

4242
[JsonConverter(typeof(NetoDateNullConverter<DateTime>))]
4343
public DateTime? PromotionStartDate { get; set; }
@@ -63,13 +63,13 @@ public class Item
6363
[JsonConverter(typeof(NetoDateNullConverter<DateTime>))]
6464
public DateTime? DateArrivalUTC { get; set; }
6565

66-
public decimal CostPrice { get; set; }
66+
public decimal? CostPrice { get; set; }
6767

6868
public string UnitOfMeasure { get; set; }
6969

7070
public string BaseUnitOfMeasure { get; set; }
7171

72-
public decimal BaseUnitPerQuantity { get; set; }
72+
public decimal? BaseUnitPerQuantity { get; set; }
7373

7474
public string BuyUnitQuantity { get; set; }
7575

@@ -83,19 +83,19 @@ public class Item
8383

8484
public string PickZone { get; set; }
8585

86-
public bool Approved { get; set; }
86+
public bool? Approved { get; set; }
8787

88-
public bool IsActive { get; set; }
88+
public bool? IsActive { get; set; }
8989

90-
public bool Visible { get; set; }
90+
public bool? Visible { get; set; }
9191

92-
public bool TaxFreeItem { get; set; }
92+
public bool? TaxFreeItem { get; set; }
9393

94-
public bool TaxInclusive { get; set; }
94+
public bool? TaxInclusive { get; set; }
9595

96-
public bool ApprovedForPOS { get; set; }
96+
public bool? ApprovedForPOS { get; set; }
9797

98-
public bool ApprovedForMobileStore { get; set; }
98+
public bool? ApprovedForMobileStore { get; set; }
9999

100100
public string SearchKeywords { get; set; }
101101

@@ -190,20 +190,20 @@ public class Item
190190

191191
public string AssetAccount { get; set; }
192192

193-
public decimal ItemHeight { get; set; }
193+
public decimal? ItemHeight { get; set; }
194194

195-
public decimal ItemLength { get; set; }
195+
public decimal? ItemLength { get; set; }
196196

197-
public decimal ItemWidth { get; set; }
197+
public decimal? ItemWidth { get; set; }
198198

199-
public decimal ShippingHeight { get; set; }
200-
public decimal ShippingLength { get; set; }
199+
public decimal? ShippingHeight { get; set; }
200+
public decimal? ShippingLength { get; set; }
201201

202-
public decimal ShippingWidth { get; set; }
202+
public decimal? ShippingWidth { get; set; }
203203

204-
public decimal ShippingWeight { get; set; }
204+
public decimal? ShippingWeight { get; set; }
205205

206-
public decimal CubicWeight { get; set; }
206+
public decimal? CubicWeight { get; set; }
207207

208208
public string SupplierItemCode { get; set; }
209209

@@ -215,9 +215,9 @@ public class Item
215215

216216
public string DisplayTemplate { get; set; }
217217

218-
public bool EditableKitBundle { get; set; }
218+
public bool? EditableKitBundle { get; set; }
219219

220-
public bool RequiresPackaging { get; set; }
220+
public bool? RequiresPackaging { get; set; }
221221

222222
public string SEOPageTitle { get; set; }
223223

@@ -229,25 +229,25 @@ public class Item
229229

230230
public string SEOCanonicalURL { get; set; }
231231

232-
public bool IsAsset { get; set; }
232+
public bool? IsAsset { get; set; }
233233

234234
public string WhenToRepeatOnStandingOrders { get; set; }
235235

236-
public bool SerialTracking { get; set; }
236+
public bool? SerialTracking { get; set; }
237237

238238
public string Group { get; set; }
239239

240240
public string ShippingCategory { get; set; }
241241

242242
public string Job { get; set; }
243243

244-
public decimal MonthlySpendRequirement { get; set; }
244+
public decimal? MonthlySpendRequirement { get; set; }
245245

246246
public string RestrictedToUserGroup { get; set; }
247247

248248
public string ItemURL { get; set; }
249249

250-
public bool AutomaticURL { get; set; }
250+
public bool? AutomaticURL { get; set; }
251251

252252
public string CommittedQuantity { get; set; }
253253

@@ -423,12 +423,12 @@ public class PriceGroup
423423
{
424424
public string GroupID { get; set; }
425425
public string Group { get; set; }
426-
public decimal Price { get; set; }
427-
public decimal PromotionPrice { get; set; }
428-
public int MinimumQuantity { get; set; }
429-
public int MaximumQuantity { get; set; }
430-
public int Multiple { get; set; }
431-
public int MultipleStartQuantity { get; set; }
426+
public decimal? Price { get; set; }
427+
public decimal? PromotionPrice { get; set; }
428+
public int? MinimumQuantity { get; set; }
429+
public int? MaximumQuantity { get; set; }
430+
public int? Multiple { get; set; }
431+
public int? MultipleStartQuantity { get; set; }
432432
}
433433

434434
public class ItemSpecifics
@@ -476,7 +476,7 @@ public class WarehouseLocation
476476
public string LocationID { get; set; }
477477
public string WarehouseID { get; set; }
478478
public string Type { get; set; }
479-
public int Priority { get; set; }
479+
public int? Priority { get; set; }
480480
}
481481

482482
public class KitComponents
@@ -487,10 +487,10 @@ public class KitComponent
487487
{
488488
public string ComponentSKU { get; set; }
489489
public string ComponentValue { get; set; }
490-
public int AssembleQuantity { get; set; }
491-
public int MinimumQuantity { get; set; }
492-
public int MaximumQuantity { get; set; }
493-
public int SortOrder { get; set; }
490+
public int? AssembleQuantity { get; set; }
491+
public int? MinimumQuantity { get; set; }
492+
public int? MaximumQuantity { get; set; }
493+
public int? SortOrder { get; set; }
494494
}
495495

496496
public class FreeGift
@@ -509,7 +509,7 @@ public class UpsellProduct
509509

510510
public class RelatedContents
511511
{
512-
public int ContentID { get; set; }
512+
public int? ContentID { get; set; }
513513
public string ContentName { get; set; }
514514
public string ContentTypeName { get; set; }
515515
}

0 commit comments

Comments
 (0)