26 lines
977 B
C#
26 lines
977 B
C#
using Inspectron.Epson.PrintServer.Printers.Utils.OrderItems;
|
|
|
|
namespace Inspectron.Epson.PrintServer.Printers.Utils;
|
|
|
|
public class ReceiptConverterFactory : IReceiptConverterFactory
|
|
{
|
|
public IReceiptConverter Create(int receiptType, int lineWidth, int bigFontLineWidth)
|
|
{
|
|
return (EReceiptType)receiptType switch
|
|
{
|
|
EReceiptType.Receipt => new FinalReceipt.FinalReceiptConverter(lineWidth, bigFontLineWidth),
|
|
EReceiptType.WorkareaTicket => new KitchenReceipt.KitchenReceiptConverterAdapter(33, 20),
|
|
EReceiptType.NextCourse => new KitchenReceipt.KitchenReceiptConverterAdapter(33, 20),
|
|
EReceiptType.OrdersOverview => new OrderItemsReceiptConverter(lineWidth, bigFontLineWidth),
|
|
_ => throw new ArgumentException($"Unknown receipt type: {receiptType}")
|
|
};
|
|
}
|
|
public enum EReceiptType
|
|
{
|
|
Receipt,
|
|
WorkareaTicket,
|
|
NextCourse,
|
|
OrdersOverview
|
|
}
|
|
}
|