namespace Inspectron.Epson.TemplateEngine.Parsing;

public abstract class TemplateNode
{
    public List<TemplateNode> Children { get; set; } = new();
}

public class ReceiptNode : TemplateNode { }

public class LineNode : TemplateNode
{
    public string? Text { get; set; }
    public bool Bold { get; set; }
    public bool Big { get; set; }
    public bool Tall { get; set; }
    public bool Red { get; set; }
    public string Align { get; set; } = "left";
    public int? LineSpacing { get; set; }
    public bool Wrap { get; set; }
    public int WrapIndent { get; set; }
}

public class ColumnsNode : TemplateNode
{
    public string? Left { get; set; }
    public string? Right { get; set; }
    public bool Bold { get; set; }
    public bool Big { get; set; }
    public bool Tall { get; set; }
    public bool Red { get; set; }
    public int? LineSpacing { get; set; }
    public bool Wrap { get; set; }
    public int WrapIndent { get; set; }
}

public class RowNode : TemplateNode
{
    public List<ColumnDef> Columns { get; set; } = new();
    public bool Bold { get; set; }
    public bool Big { get; set; }
    public bool Tall { get; set; }
    public bool Red { get; set; }
    public int? LineSpacing { get; set; }
}

public class ColumnDef
{
    public string? Text { get; set; }
    public int? Width { get; set; }
    public double? WidthPercent { get; set; }
    public string Align { get; set; } = "left";
    public bool Wrap { get; set; }
}

public class SeparatorNode : TemplateNode
{
    public char Character { get; set; } = '-';
}

public class CutNode : TemplateNode { }

public class FeedNode : TemplateNode
{
    public int Lines { get; set; } = 1;
}

public class ForeachNode : TemplateNode
{
    public string Items { get; set; } = "";
    public string Var { get; set; } = "";
}

public class IfNode : TemplateNode
{
    public string Test { get; set; } = "";
}

public class ElseNode : TemplateNode { }

public class TableNode : TemplateNode
{
    public List<ColumnDef> Columns { get; set; } = new();
    public string? HeaderItems { get; set; }
    public string? Items { get; set; }
    public string? Var { get; set; }
}
