From 573a37be3b3ed462a3d02d1bf3170b116e2535e4 Mon Sep 17 00:00:00 2001 From: Thomas Danzl Date: Fri, 6 Mar 2026 12:37:01 +0100 Subject: [PATCH] #12 take care the ftPayItemId is null if empty to avoid issues with backend API (reject because of 400 BAD REUEST on /sign) --- libPosSystemAPI/DTO/PayItem.cs | 2 +- libPosSystemAPI/DTO/ReceiptRequest.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) 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(); }