using System;
using System.Collections.Generic;

namespace Haoliang.Models.Template
{
    public class CNCBrandTemplate
    {
        public int Id { get; set; }
        public string BrandName { get; set; }
        public string Description { get; set; }
        public bool IsEnabled { get; set; }
        public List<TemplateFieldMapping> FieldMappings { get; set; } = new List<TemplateFieldMapping>();
        public DateTime CreatedAt { get; set; }
        public DateTime UpdatedAt { get; set; }
    }

    public class TemplateFieldMapping
    {
        public int Id { get; set; }
        public int TemplateId { get; set; }
        public string SourceFieldPath { get; set; }
        public string StandardFieldId { get; set; }
        public string StandardFieldDesc { get; set; }
        public string DataType { get; set; }
        public ConversionRule ConversionRule { get; set; }
        public DateTime CreatedAt { get; set; }
    }

    public class ConversionRule
    {
        public string Type { get; set; }
        public Dictionary<string, object> Parameters { get; set; }
    }

    public class TemplateFieldMappingViewModel
    {
        public int Id { get; set; }
        public string SourceFieldPath { get; set; }
        public string StandardFieldId { get; set; }
        public string StandardFieldDesc { get; set; }
        public string DataType { get; set; }
        public string ConversionRuleType { get; set; }
        public Dictionary<string, object> ConversionRuleParameters { get; set; }
    }

    public class CNCBrandTemplateViewModel
    {
        public int Id { get; set; }
        public string BrandName { get; set; }
        public string Description { get; set; }
        public bool IsEnabled { get; set; }
        public List<TemplateFieldMappingViewModel> FieldMappings { get; set; }
        public DateTime CreatedAt { get; set; }
        public DateTime UpdatedAt { get; set; }
    }
}