{
  "slug":         "contact-list",
  "name":         "Contact list (CRM-lite)",
  "description":  "A simple address book - contacts collection with email/phone/company/tags, a quick-add form, and a single status transition for follow-ups.",
  "icon":         "users",
  "options": [
    { "name": "collectionSlug", "label": "Collection slug", "default": "contacts",         "hint": "Where contact records are stored" },
    { "name": "formSlug",       "label": "Form slug",       "default": "contact-quick-add", "hint": "Embedded via [form name=\"...\" /]" },
    { "name": "actionPrefix",   "label": "Action slug prefix", "default": "contact",       "hint": "Per-action slug: <prefix>-followup" }
  ],
  "collection": {
    "title":       "Contacts",
    "description": "Address-book entries",
    "fields": [
      { "name": "fullName", "label": "Full name",   "type": "text",  "required": true },
      { "name": "email",    "label": "Email",       "type": "email" },
      { "name": "phone",    "label": "Phone",       "type": "text" },
      { "name": "company",  "label": "Company",     "type": "text" },
      {
        "name": "tags", "label": "Tags", "type": "multiselect",
        "options": [
          { "value": "lead",     "label": "Lead" },
          { "value": "customer", "label": "Customer" },
          { "value": "partner",  "label": "Partner" },
          { "value": "vendor",   "label": "Vendor" }
        ]
      },
      { "name": "notes",    "label": "Notes",       "type": "textarea" },
      {
        "name": "status", "label": "Status", "type": "select",
        "options": [
          { "value": "active",   "label": "Active" },
          { "value": "followup", "label": "Needs follow-up" },
          { "value": "archived", "label": "Archived" }
        ]
      }
    ],
    "api": {
      "read":   { "enabled": false },
      "create": { "enabled": false },
      "update": { "enabled": false },
      "delete": { "enabled": false }
    }
  },
  "form": {
    "title":       "Add a contact",
    "fields": [
      { "name": "fullName", "label": "Full name", "type": "text",  "required": true },
      { "name": "email",    "label": "Email",     "type": "email" },
      { "name": "phone",    "label": "Phone",     "type": "text" },
      { "name": "company",  "label": "Company",   "type": "text" },
      { "name": "notes",    "label": "Notes",     "type": "textarea" }
    ],
    "settings": {
      "submitText":     "Add contact",
      "successMessage": "Contact added.",
      "honeypot":       true,
      "rateLimitPerMinute": 10
    },
    "actions": { "collection": { "enabled": true, "slug": "" } }
  },
  "actions": [
    {
      "slug":        "{{actionPrefix}}-followup",
      "title":       "Mark for follow-up",
      "description": "Flag this contact as needing follow-up.",
      "collection":  "{{collectionSlug}}",
      "trigger":     { "label": "Flag follow-up", "icon": "flag", "style": "warning" },
      "transition":  { "field": "status", "from": ["active"], "to": "followup" },
      "access":      { "roles": ["admin", "super-admin"] },
      "steps": [
        { "type": "updateField", "config": { "field": "status", "value": "followup" } }
      ]
    }
  ],
  "wireForm": true,
  "snippet":  "[form name=\"{{formSlug}}\" /]\n\n## Contacts\n\n[collection slug=\"{{collectionSlug}}\" display=\"table\" searchable filterable=\"status,tags\" sortable transitions /]"
}
