{
  "formId": "directactiondetail",
  "entity": "directactiondetail",
  "title": "DirectAction Detail (Button/Link)",
  "idField": "DirectActionDetailId",
  "pages": [
    {
      "pageId": "main",
      "pageName": "DirectAction Detail",
      "sections": [
        {
          "sectionId": "general",
          "sectionName": "Button / Link",
          "layout": { "columns": 12 },
          "fields": [
            {
              "fieldId": "DirectActionDetailId",
              "label": "Id",
              "type": "number",
              "ReadOnly": true,
              "DefaultValue": 0,
              "PostData": true,
              "layout": { "colSpan": 3 }
            },
            {
              "fieldId": "DirectActionId",
              "label": "DirectAction Group Id",
              "type": "number",
              "mandatory": true,
              "DefaultValue": 0,
              "layout": { "colSpan": 4 }
            },
            {
              "fieldId": "Slno",
              "label": "Sequence No.",
              "type": "number",
              "DefaultValue": 1,
              "layout": { "colSpan": 3 }
            },
            {
              "fieldId": "ActionCode",
              "label": "Action Code (token key)",
              "type": "text",
              "mandatory": true,
              "pattern": "^[A-Za-z0-9_]{1,50}$",
              "DefaultValue": "",
              "layout": { "colSpan": 5 }
            },
            {
              "fieldId": "ActionLabel",
              "label": "Action Label",
              "type": "text",
              "mandatory": true,
              "DefaultValue": "",
              "layout": { "colSpan": 5 }
            },
            {
              "fieldId": "EmailPlaceholder",
              "label": "Email Placeholder (##X##)",
              "type": "text",
              "DefaultValue": "",
              "layout": { "colSpan": 6 }
            },
            {
              "fieldId": "ButtonPayloadPrefix",
              "label": "WhatsApp Button Payload Prefix",
              "type": "text",
              "DefaultValue": "",
              "layout": { "colSpan": 6 }
            },
            {
              "fieldId": "ApiEndpoint",
              "label": "API Endpoint",
              "type": "text",
              "mandatory": true,
              "DefaultValue": "",
              "layout": { "colSpan": 8 }
            },
            {
              "fieldId": "HttpMethod",
              "label": "HTTP Method",
              "type": "select",
              "mandatory": true,
              "DefaultValue": "POST",
              "lookup": {
                "valueField": "value",
                "displayField": "label",
                "options": [
                  { "value": "POST", "label": "POST" },
                  { "value": "PUT", "label": "PUT" },
                  { "value": "PATCH", "label": "PATCH" },
                  { "value": "DELETE", "label": "DELETE" }
                ]
              },
              "layout": { "colSpan": 4 }
            },
            {
              "fieldId": "PayloadTemplate",
              "label": "Payload Template (JSON, supports {ContextId}/{Remarks})",
              "type": "textarea",
              "mandatory": true,
              "DefaultValue": "{}",
              "layout": { "colSpan": 12 }
            },
            {
              "fieldId": "NeedsInput",
              "label": "Needs Input",
              "type": "select",
              "DefaultValue": 0,
              "lookup": {
                "valueField": "value",
                "displayField": "label",
                "options": [
                  { "value": 0, "label": "No — direct API call" },
                  { "value": 1, "label": "Yes — show remarks form / conversational flow" }
                ]
              },
              "layout": { "colSpan": 6 }
            },
            {
              "fieldId": "FlowId",
              "label": "Conversational Flow Id (-1 = not used)",
              "type": "number",
              "DefaultValue": -1,
              "layout": { "colSpan": 6 }
            }
          ]
        }
      ]
    }
  ],
  "api": {
    "save": "Framework.DirectActionDetail.Save",
    "get": "Framework.DirectActionDetail.Get",
    "delete": "Framework.DirectActionDetail.Delete"
  }
}
