{
  "id": "customers",
  "label": "Clientes",
  "description": "Gestión de clientes (alta, listado, búsqueda).",
  "entities": [
    {
      "name": "customer",
      "label": "Cliente",
      "fields": [
        { "name": "name", "label": "Nombre", "kind": "text", "required": true },
        { "name": "email", "label": "Email", "kind": "text", "required": false, "help": "Opcional, formato libre por ahora" },
        { "name": "phone", "label": "Teléfono", "kind": "text", "required": false },
        { "name": "active", "label": "Activo", "kind": "boolean", "default": "true" },
        { "name": "credit_limit", "label": "Límite de crédito", "kind": "number", "default": "0" },
        { "name": "notes", "label": "Notas", "kind": "multiline", "required": false }
      ]
    }
  ],
  "menu": [
    { "label": "Listar", "view": "list", "icon": "📋" },
    { "label": "Nuevo", "view": "form", "icon": "✚" }
  ],
  "views": {
    "list": {
      "kind": "list",
      "title": "Clientes",
      "entity": "customer",
      "columns": [
        { "field": "name", "label": "Nombre", "weight": 2.0 },
        { "field": "email", "label": "Email", "weight": 3.0 },
        { "field": "phone", "label": "Teléfono", "weight": 1.5 },
        { "field": "active", "label": "Activo", "weight": 0.7 },
        { "field": "credit_limit", "label": "Límite", "weight": 1.0 }
      ],
      "actions": [
        { "kind": "open_view", "view": "form", "label": "✚ Nuevo" }
      ],
      "search_in": ["name", "email", "phone"]
    },
    "form": {
      "kind": "form",
      "title": "Nuevo cliente",
      "entity": "customer",
      "fields": [
        { "name": "name", "label": "Nombre", "kind": "text", "required": true },
        { "name": "email", "label": "Email", "kind": "text", "required": false },
        { "name": "phone", "label": "Teléfono", "kind": "text", "required": false },
        { "name": "active", "label": "Activo", "kind": "boolean", "default": "true" },
        { "name": "credit_limit", "label": "Límite de crédito", "kind": "number", "default": "0" },
        { "name": "notes", "label": "Notas", "kind": "multiline" }
      ],
      "on_submit": {
        "kind": "seed_entity",
        "entity": "customer",
        "next_view": "list"
      }
    }
  }
}
