Skip to content

Commit 573a37b

Browse files
author
Thomas Danzl
committed
#12 take care the ftPayItemId is null if empty to avoid issues with backend API (reject because of 400 BAD REUEST on /sign)
1 parent 6fea609 commit 573a37b

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

libPosSystemAPI/DTO/PayItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace fiskaltrust.DevKit.POSSystemAPI.lib.DTO
66
public class PayItem
77
{
88
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
9-
public string ftPayItemId { get; set; } = string.Empty;
9+
public string? ftPayItemId { get; set; } = string.Empty;
1010

1111
public string Description { get; set; } = string.Empty;
1212
public decimal Amount { get; set; }

libPosSystemAPI/DTO/ReceiptRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ public ReceiptRequest(string cbReceiptReference, ReceiptCaseBuilder buildableRec
2424
{
2525
this.cbReceiptReference = cbReceiptReference;
2626
this.cbChargeItems = cbChargeItems;
27+
// verify that empty ftPayItemIDs are null
28+
foreach (var payItem in cbPayItems)
29+
{
30+
if (payItem.ftPayItemId == "")
31+
{
32+
payItem.ftPayItemId = null;
33+
}
34+
}
2735
this.cbPayItems = cbPayItems;
2836
this.ftReceiptCase = buildableReceiptCase.Build();
2937
}

0 commit comments

Comments
 (0)