{
  "id": "suppliers",
  "label": "Proveedores",
  "description": "Proveedores que abastecen el catálogo.",
  "entities": [
    {
      "name": "supplier",
      "label": "Proveedor",
      "fields": [
        { "name": "name", "label": "Razón social", "kind": "text", "required": true },
        { "name": "tax_id", "label": "ID fiscal", "kind": "text", "required": true, "help": "RUT/RFC/NIT/EIN según país" },
        { "name": "contact", "label": "Contacto", "kind": "text" },
        { "name": "email", "label": "Email", "kind": "text" },
        { "name": "phone", "label": "Teléfono", "kind": "text" },
        { "name": "payment_terms_days", "label": "Términos de pago (días)", "kind": "number", "default": "30" },
        { "name": "active", "label": "Activo", "kind": "boolean", "default": "true" }
      ]
    }
  ],
  "menu": [
    { "label": "Listar", "view": "list", "icon": "🏭" },
    { "label": "Nuevo", "view": "form", "icon": "✚" }
  ],
  "views": {
    "list": {
      "kind": "list",
      "title": "Proveedores",
      "entity": "supplier",
      "columns": [
        { "field": "name", "label": "Razón social", "weight": 2.5 },
        { "field": "tax_id", "label": "ID fiscal", "weight": 1.2 },
        { "field": "contact", "label": "Contacto", "weight": 1.5 },
        { "field": "email", "label": "Email", "weight": 2.0 },
        { "field": "payment_terms_days", "label": "Términos", "weight": 0.8 },
        { "field": "active", "label": "Activo", "weight": 0.5 }
      ],
      "actions": [
        { "kind": "open_view", "view": "form", "label": "✚ Nuevo" }
      ],
      "search_in": ["name", "tax_id", "contact", "email"]
    },
    "form": {
      "kind": "form",
      "title": "Nuevo proveedor",
      "entity": "supplier",
      "fields": [
        { "name": "name", "label": "Razón social", "kind": "text", "required": true },
        { "name": "tax_id", "label": "ID fiscal", "kind": "text", "required": true },
        { "name": "contact", "label": "Persona de contacto", "kind": "text" },
        { "name": "email", "label": "Email", "kind": "text" },
        { "name": "phone", "label": "Teléfono", "kind": "text" },
        { "name": "payment_terms_days", "label": "Términos de pago (días)", "kind": "number", "default": "30" },
        { "name": "active", "label": "Activo", "kind": "boolean", "default": "true" }
      ],
      "on_submit": {
        "kind": "seed_entity",
        "entity": "supplier",
        "next_view": "list"
      }
    }
  }
}
