test run works

This commit is contained in:
EugeneTes
2026-01-20 10:11:04 +01:00
parent 4720ca2d57
commit 6f5116736c
22 changed files with 351 additions and 441 deletions

View File

@@ -0,0 +1,22 @@
using System.Text.Json;
namespace Inspectron.Epson.PrintServer.Printers.Utils.OrderItems;
public class OrderItemsReceiptConverter : IReceiptConverter
{
private readonly int _lineWidth;
private readonly int _bigFontLineWidth;
public OrderItemsReceiptConverter(int lineWidth, int bigFontLineWidth)
{
_lineWidth = lineWidth;
_bigFontLineWidth = bigFontLineWidth;
}
public List<PrintCommand> Convert(string jsonContent)
{
var receipt = JsonSerializer.Deserialize<OrderItemsReceipt>(jsonContent);
var converter = new ReceiptConverter(_lineWidth, _bigFontLineWidth);
return converter.ConvertToPrintCommands(receipt);
}
}

View File

@@ -159,10 +159,10 @@ public class ReceiptConverter
}
}
// Comment
// SpecialInstruction
if (!string.IsNullOrEmpty(item.Comment))
{
commands.Add(new PrintCommand($" Comment: {item.Comment}"));
commands.Add(new PrintCommand($" SpecialInstruction: {item.Comment}"));
}
}