{
  "@context": {
    "ixo": "https://w3id.org/ixo/ns/protocol/",
    "@id": "@type",
    "type": "@type",
    "@protected": true
  },
  "type": "ixo:entity#surveyTemplate",
  "question": {
    "title": "SupaMoto Agent Update",
    "description": "Update the details of a registered SupaMoto agent. Only the Agent ID is required - fill in only the fields that are changing.",
    "pages": [
      {
        "name": "update",
        "elements": [
          {
            "type": "text",
            "name": "ecs:agentId",
            "title": "Agent ID",
            "description": "The SupaMoto Agent ID (e.g. A21009802).",
            "isRequired": true
          },
          {
            "type": "text",
            "name": "schema:givenName",
            "title": "Name"
          },
          {
            "type": "text",
            "name": "schema:familyName",
            "title": "Surname"
          },
          {
            "type": "text",
            "name": "schema:email",
            "title": "Email",
            "validators": [
              {
                "type": "email",
                "text": "Please enter a valid email address."
              }
            ],
            "inputType": "email"
          },
          {
            "type": "text",
            "name": "schema:telephone",
            "title": "Phone number",
            "validators": [
              {
                "type": "regex",
                "text": "Please enter the phone number in international format, including the country code (e.g. +260977123456).",
                "regex": "^\\+[1-9]\\d{6,14}$"
              }
            ],
            "inputType": "tel"
          }
        ],
        "title": "Agent Details to Update"
      },
      {
        "name": "reviewAndSubmit",
        "elements": [
          {
            "type": "html",
            "name": "reviewMessage",
            "html": "<h3>Thank you for updating these agent details!</h3><p>Please review your answers below before submitting.</p>"
          }
        ],
        "title": "Thank You"
      }
    ],
    "checkErrorsMode": "onValueChanged",
    "validateVisitedEmptyFields": true,
    "textUpdateMode": "onTyping",
    "showPreviewBeforeComplete": true
  }
}
