using System.Text.Json.Serialization;
namespace FoodLabeling.Application.Contracts.Dtos.LabelTemplate;
///
/// 模板元素(对齐 editor JSON:id/type/typeAdd/elementName/x/y/width/height/rotation/border/config 等)
///
public class LabelTemplateElementDto
{
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("type")]
public string ElementType { get; set; } = string.Empty;
///
/// 元素附加类型(分组前缀 + 控件名),如 label_Duration
///
[JsonPropertyName("typeAdd")]
public string? TypeAdd { get; set; }
[JsonPropertyName("elementName")]
public string ElementName { get; set; } = string.Empty;
[JsonPropertyName("x")]
public decimal PosX { get; set; }
[JsonPropertyName("y")]
public decimal PosY { get; set; }
[JsonPropertyName("width")]
public decimal Width { get; set; }
[JsonPropertyName("height")]
public decimal Height { get; set; }
[JsonPropertyName("rotation")]
public string Rotation { get; set; } = "horizontal";
[JsonPropertyName("border")]
public string BorderType { get; set; } = "none";
[JsonPropertyName("zIndex")]
public int ZIndex { get; set; }
[JsonPropertyName("orderNum")]
public int OrderNum { get; set; }
///
/// 值来源:FIXED / AUTO_DB / PRINT_INPUT
///
[JsonPropertyName("valueSourceType")]
public string ValueSourceType { get; set; } = "FIXED";
[JsonPropertyName("bindingExpr")]
public string? BindingExpr { get; set; }
[JsonPropertyName("autoQueryKey")]
public string? AutoQueryKey { get; set; }
[JsonPropertyName("inputKey")]
public string? InputKey { get; set; }
[JsonPropertyName("isRequiredInput")]
public bool IsRequiredInput { get; set; }
///
/// 元素配置
///
[JsonPropertyName("config")]
public object? ConfigJson { get; set; }
}