diff --git a/libPosSystemAPI/DTO/PayItem.cs b/libPosSystemAPI/DTO/PayItem.cs index b42ab6e..b412a43 100644 --- a/libPosSystemAPI/DTO/PayItem.cs +++ b/libPosSystemAPI/DTO/PayItem.cs @@ -6,7 +6,7 @@ namespace fiskaltrust.DevKit.POSSystemAPI.lib.DTO public class PayItem { [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] - public string ftPayItemId { get; set; } = string.Empty; + public string? ftPayItemId { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; public decimal Amount { get; set; } diff --git a/libPosSystemAPI/DTO/ReceiptRequest.cs b/libPosSystemAPI/DTO/ReceiptRequest.cs index 12a6d96..a33b458 100644 --- a/libPosSystemAPI/DTO/ReceiptRequest.cs +++ b/libPosSystemAPI/DTO/ReceiptRequest.cs @@ -24,6 +24,14 @@ public ReceiptRequest(string cbReceiptReference, ReceiptCaseBuilder buildableRec { this.cbReceiptReference = cbReceiptReference; this.cbChargeItems = cbChargeItems; + // verify that empty ftPayItemIDs are null + foreach (var payItem in cbPayItems) + { + if (payItem.ftPayItemId == "") + { + payItem.ftPayItemId = null; + } + } this.cbPayItems = cbPayItems; this.ftReceiptCase = buildableReceiptCase.Build(); }