namespace PrintService.Models;
///
/// Root configuration loaded from printer-config.json
///
public class PrinterConfiguration
{
public Dictionary DocumentTypes { get; set; } = new();
}
///
/// Configuration for a single document type (replaces DocumentConfig for printer/tray mapping)
///
public class DocumentTypeConfig
{
public string Name { get; set; } = string.Empty;
public List Pages { get; set; } = new();
// Rendering settings
public string FontName { get; set; } = "Courier New";
public float FontSize { get; set; } = 10f;
public int HorizontalOffset { get; set; } = 0;
public int VerticalOffset { get; set; } = 0;
// Post-processing settings
public bool ArchiveAfterPrint { get; set; } = true;
public string? ArchivePath { get; set; }
public string? OutputPath { get; set; }
public bool SkipPostProcessing { get; set; } = false;
// Text transformation rules
public List Transformations { get; set; } = new();
// Rust transformation properties
///
/// Left margin/indent for all lines (in 1/100 inch units)
///
public int LinePadding { get; set; } = 0;
///
/// Remove both "Order #: " label and the order number entirely
///
public bool RemoveOrderNumber { get; set; } = false;
///
/// Remove "Order #: " label but keep the order number (and make it bold)
///
public bool RemoveOrderNumberLabel { get; set; } = false;
///
/// Add spacing before the order number (shifts it right)
///
public string IndentOrderNumber { get; set; } = string.Empty;
///
/// Vertical position adjustments per line (line number → adjustment in 1/100 inch)
/// Negative values move up, positive values move down
///
public Dictionary RowShift { get; set; } = new();
///
/// Horizontal character trimming per line (line number → trim configuration)
/// Removes characters from Start to End indices
///
public Dictionary RowTrim { get; set; } = new();
}
///
/// Configuration for a single page (printer and tray assignment)
///
public class PageConfig
{
public int PageNumber { get; set; }
public string PrinterName { get; set; } = string.Empty;
public int TrayNumber { get; set; }
public string? TrayLabel { get; set; }
}
///
/// Configuration for row trimming (horizontal character removal)
///
public class RowTrimConfig
{
///
/// Start index of characters to remove (0-based)
///
public int Start { get; set; }
///
/// End index of characters to remove (exclusive)
///
public int End { get; set; }
}