{
  "@context": {
    "ixo": "https://w3id.org/ixo/ns/protocol/",
    "@id": "@type",
    "type": "@type",
    "@protected": true
  },
  "type": "ixo:entity#surveyTemplate",
  "question": {
    "title": "3CX CDR Claim",
    "description": "Claim template for telecom CDR-backed claims with semantic field naming.",
    "pages": [
      {
        "name": "claimCDR",
        "elements": [
          {
            "type": "panel",
            "name": "identifiers",
            "elements": [
              {
                "type": "text",
                "name": "ixo:callId",
                "title": "Call ID",
                "isRequired": true,
                "readOnly": true,
                "validators": [
                  {
                    "type": "regex",
                    "text": "Must be a valid UUID.",
                    "regex": "^[0-9a-fA-F-]{36}$"
                  }
                ]
              },
              {
                "type": "text",
                "name": "ixo:callHistoryId",
                "title": "Call History ID",
                "isRequired": true,
                "readOnly": true,
                "validators": [
                  {
                    "type": "regex",
                    "text": "Must be a valid UUID.",
                    "regex": "^[0-9a-fA-F-]{36}$"
                  }
                ]
              }
            ],
            "title": "Identifiers"
          },
          {
            "type": "panel",
            "name": "timing",
            "elements": [
              {
                "type": "text",
                "name": "schema:startDate",
                "title": "Call Started At",
                "isRequired": true,
                "readOnly": true,
                "validators": [
                  {
                    "type": "regex",
                    "text": "Must be ISO 8601 UTC.",
                    "regex": "^\\d{4}-\\d{2}-\\d{2}T.*Z$"
                  }
                ]
              },
              {
                "type": "text",
                "name": "ixo:callAnsweredAt",
                "title": "Call Answered At",
                "readOnly": true
              },
              {
                "type": "text",
                "name": "schema:endDate",
                "title": "Call Ended At",
                "isRequired": true,
                "readOnly": true
              },
              {
                "type": "text",
                "name": "ixo:durationSeconds",
                "title": "Duration Seconds",
                "isRequired": true,
                "readOnly": true,
                "inputType": "number"
              },
              {
                "type": "text",
                "name": "ixo:talkTimeSeconds",
                "title": "Talk Time Seconds",
                "readOnly": true,
                "inputType": "number"
              }
            ],
            "title": "Call Timing"
          },
          {
            "type": "panel",
            "name": "routing",
            "elements": [
              {
                "type": "dropdown",
                "name": "ixo:creationMethod",
                "title": "Creation Method",
                "isRequired": true,
                "readOnly": true,
                "choices": [
                  "call_init",
                  "transfer",
                  "pickup"
                ]
              },
              {
                "type": "dropdown",
                "name": "ixo:forwardReason",
                "title": "Forward Reason",
                "readOnly": true
              },
              {
                "type": "text",
                "name": "ixo:callChain",
                "title": "Call Chain",
                "readOnly": true
              }
            ],
            "title": "Call Routing"
          },
          {
            "type": "panel",
            "name": "source",
            "elements": [
              {
                "type": "text",
                "name": "schema:telephone",
                "title": "Source Number",
                "isRequired": true,
                "readOnly": true
              },
              {
                "type": "text",
                "name": "schema:name",
                "title": "Source Name",
                "readOnly": true
              },
              {
                "type": "dropdown",
                "name": "ixo:sourceEntityType",
                "title": "Source Entity Type",
                "isRequired": true,
                "readOnly": true,
                "choices": [
                  "extension",
                  "external_line"
                ]
              },
              {
                "type": "text",
                "name": "schema:department",
                "title": "Source Department",
                "readOnly": true
              }
            ],
            "title": "Source Participant"
          },
          {
            "type": "panel",
            "name": "destination",
            "elements": [
              {
                "type": "text",
                "name": "ixo:destinationNumber",
                "title": "Destination Number",
                "isRequired": true,
                "readOnly": true
              },
              {
                "type": "text",
                "name": "ixo:destinationName",
                "title": "Destination Name",
                "readOnly": true
              },
              {
                "type": "dropdown",
                "name": "ixo:destinationEntityType",
                "title": "Destination Entity Type",
                "isRequired": true,
                "readOnly": true,
                "choices": [
                  "queue",
                  "extension"
                ]
              },
              {
                "type": "text",
                "name": "ixo:finalNumber",
                "title": "Final Number",
                "readOnly": true
              }
            ],
            "title": "Destination Participant"
          },
          {
            "type": "panel",
            "name": "termination",
            "elements": [
              {
                "type": "dropdown",
                "name": "ixo:terminationReason",
                "title": "Termination Reason",
                "isRequired": true,
                "readOnly": true
              },
              {
                "type": "dropdown",
                "name": "ixo:terminationDetail",
                "title": "Termination Detail",
                "readOnly": true
              },
              {
                "type": "text",
                "name": "schema:price",
                "title": "Bill Cost",
                "readOnly": true,
                "inputType": "number"
              },
              {
                "type": "text",
                "name": "ixo:missedQueueAgents",
                "title": "Missed Queue Agents",
                "readOnly": true
              }
            ],
            "title": "Termination & Billing"
          }
        ],
        "title": "Call Detail Record"
      }
    ],
    "clearInvisibleValues": "none",
    "checkErrorsMode": "onValueChanged"
  }
}