{
  "_doc": "Cấu hình các trường thông tin cho mỗi mẫu NCC. Khi upload mẫu mới, user chọn trường nào cần sửa và loại sửa (user_input hoặc auto_fill). Hệ thống sinh giao diện tương ứng.",

  "_field_types": {
    "user_input": "Người dùng tự nhập khi tạo cert (VD: PO No, Quantity, Heat No)",
    "auto_fill": "Hệ thống tự điền từ dữ liệu có sẵn (VD: Size, Material, Standard, Specs)",
    "fixed": "Giá trị cố định của NCC, không đổi (VD: Company name, Address, Tel)"
  },

  "TONGMING": {
    "_supplier": "Tong Ming Enterprise",
    "_description": "Format CQ TongMing - dùng cho tất cả nhóm SP",

    "header_fields": [
      {"key": "company_name",  "label": "Company Name",     "type": "fixed",      "value": "TONG MING ENTERPRISE CO., LTD"},
      {"key": "purchaser",     "label": "PURCHASER",         "type": "fixed",      "value": "MECSU JOINT STOCK COMPANY"},
      {"key": "address",       "label": "ADDRESS",           "type": "fixed",      "value": "39 Tran Hung Dao Street, Tan Thanh Ward, Tan Phu District, Ho Chi Minh City, Vietnam"},
      {"key": "cert_no",       "label": "CERT NO",           "type": "user_input", "placeholder": "VD: 965712"},
      {"key": "cust_pn",       "label": "CUST P/N",          "type": "auto_fill",  "source": "product.part_number"},
      {"key": "po_no",         "label": "PO# NO",            "type": "user_input", "placeholder": "Nhập số PO"}
    ],

    "product_fields": [
      {"key": "size",          "label": "SIZE",              "type": "auto_fill",  "source": "product.size"},
      {"key": "material_type", "label": "MATERIAL TYPE",     "type": "auto_fill",  "source": "classification.material_code"},
      {"key": "marking",       "label": "MARKING",           "type": "auto_fill",  "source": "classification.grade", "editable": true},
      {"key": "ship_qty",      "label": "SHIP QTY",          "type": "user_input", "placeholder": "VD: 1200 PC", "suffix": "PC"},
      {"key": "heat_no",       "label": "HEAT NO",           "type": "user_input", "placeholder": "VD: NY240616AS08"},
      {"key": "lot_no",        "label": "LOT NO",            "type": "user_input", "placeholder": "VD: C738744400001"},
      {"key": "mfr",           "label": "MFR.",              "type": "fixed",      "value": "TONG MING ENTERPRISE CO.,LTD."},
      {"key": "commodity",     "label": "COMMODITY",          "type": "auto_fill",  "source": "product.standard"},
      {"key": "product_name",  "label": "Product Name",      "type": "auto_fill",  "source": "classification.group_name_en"},
      {"key": "mfr_date",      "label": "MFR.DATE",          "type": "user_input", "placeholder": "YYYY/MM/DD", "input_type": "date"},
      {"key": "surface",       "label": "Surface",           "type": "auto_fill",  "source": "header.surface", "editable": true},
      {"key": "item_no",       "label": "ITEM NO",           "type": "user_input", "placeholder": "Số item"},
      {"key": "sampling_date", "label": "Sampling Date",     "type": "user_input", "placeholder": "YYYY/MM/DD", "input_type": "date", "default": "today"},
      {"key": "test_date",     "label": "Test Date",         "type": "user_input", "placeholder": "YYYY/MM/DD", "input_type": "date", "default": "today"}
    ],

    "inspection_fields": {
      "_doc": "Phần kích thước - ĐỘNG theo nhóm SP, lấy từ cert_config.json + field_mapping.json",
      "type": "auto_fill",
      "source": "dimensional.characteristics",
      "note": "Các dòng dimensional tự thay đổi theo nhóm SP (bolt/nut/washer/screw). Giá trị spec từ bộ tiêu chuẩn, actual result random trong khoảng spec."
    },

    "mechanical_fields": {
      "_doc": "Tính chất cơ học - ĐỘNG theo grade",
      "type": "auto_fill",
      "source": "mechanical.properties",
      "note": "Tự thay đổi theo grade (A2-70, 8.8, 10.9...). Spec từ cert_config.json."
    },

    "chemical_fields": {
      "_doc": "Thành phần hóa học - ĐỘNG theo vật liệu",
      "type": "auto_fill",
      "source": "chemical.elements",
      "note": "Tự thay đổi theo material (A2/304, A4/316, Carbon Steel...). Actual values random theo range từ CQ TongMing thực tế."
    },

    "signature_fields": [
      {"key": "authorization",  "label": "Authorization",    "type": "fixed",      "value": "(stamp)"},
      {"key": "verification",   "label": "Verification",     "type": "fixed",      "value": "(signature)"},
      {"key": "sampler",        "label": "Sampler",           "type": "fixed",      "value": "Xiaoyang.W"},
      {"key": "date",           "label": "Date",              "type": "auto_fill",  "source": "header.inspection_date"}
    ]
  },

  "_template_example_new_supplier": {
    "_doc": "Ví dụ: khi thêm NCC mới (Shanghai Prime), user sẽ cấu hình tương tự TONGMING nhưng thay đổi fixed values và có thể có fields khác",
    "SHANGHAI_PRIME": {
      "_supplier": "Shanghai Prime Fasteners",
      "header_fields": [
        {"key": "company_name",  "label": "Company Name",     "type": "fixed",      "value": "SHANGHAI PRIME FASTENERS CO., LTD."},
        {"key": "purchaser",     "label": "Purchaser",         "type": "fixed",      "value": "MECSU JOINT STOCK COMPANY"},
        {"key": "cert_no",       "label": "Certificate No",    "type": "user_input", "placeholder": "Cert number"},
        {"key": "po_no",         "label": "PO Number",         "type": "user_input", "placeholder": "PO number"}
      ],
      "product_fields": [
        {"key": "size",          "label": "Size",              "type": "auto_fill",  "source": "product.size"},
        {"key": "material",      "label": "Material",          "type": "auto_fill",  "source": "classification.material_code"},
        {"key": "quantity",      "label": "Quantity",          "type": "user_input", "placeholder": "Number of pieces"},
        {"key": "heat_no",       "label": "Heat No",           "type": "user_input"},
        {"key": "lot_no",        "label": "Lot No",            "type": "user_input"}
      ]
    }
  }
}
