{
 "@context": {
  "ixo": "https://w3id.org/ixo/ns/protocol/",
  "@id": "@type",
  "type": "@type",
  "@protected": true
 },
 "type": "ixo:entity#surveyTemplate",
 "question": {
  "title": "Delivery Claim",
  "description": "Record what you delivered to a customer. A red star * means you must answer.",
  "pages": [
   {
    "name": "delivery_customer",
    "elements": [
     {
      "type": "text",
      "name": "ecs:customerId",
      "title": "SupaMoto customer ID",
      "isRequired": true
     }
    ],
    "title": "Who did you deliver to?"
   },
   {
    "name": "delivery_items",
    "elements": [
     {
      "type": "paneldynamic",
      "name": "schema:orderedItem",
      "title": "Items delivered",
      "isRequired": true,
      "templateElements": [
       {
        "type": "radiogroup",
        "name": "ecs:itemCategory",
        "title": "What kind of item is this?",
        "isRequired": true,
        "choices": [
         {
          "value": "pellets",
          "text": "Pellets (fuel)"
         },
         {
          "value": "stove",
          "text": "Stove"
         },
         {
          "value": "component",
          "text": "A part that goes inside a stove"
         },
         {
          "value": "accessory",
          "text": "A cable, charger or solar panel"
         },
         {
          "value": "appliance",
          "text": "A solar light, radio or TV kit"
         }
        ]
       },
       {
        "type": "dropdown",
        "name": "schema:weight",
        "visibleIf": "{panel.ecs:itemCategory} = 'pellets'",
        "title": "Weight of each bag",
        "isRequired": true,
        "choices": [
         "1kg",
         "5kg",
         "30kg",
         "50kg"
        ],
        "showOtherItem": true,
        "otherText": "Other weight"
       },
       {
        "type": "dropdown",
        "name": "ecs:accessoryType",
        "visibleIf": "{panel.ecs:itemCategory} anyof ['component','accessory','appliance']",
        "title": "What exactly is it?",
        "isRequired": true,
        "choices": [
         {
          "value": "combustion-chamber",
          "text": "Burning chamber"
         },
         {
          "value": "stove-mechanical-part",
          "text": "Metal stove part (plate, pot rest, lid, tool)"
         },
         {
          "value": "stove-housing-part",
          "text": "Cover, casing or knob"
         },
         {
          "value": "fan",
          "text": "Fan"
         },
         {
          "value": "battery",
          "text": "Battery"
         },
         {
          "value": "control-pcb",
          "text": "Control board"
         },
         {
          "value": "power-supply-cable",
          "text": "Charger, cable or regulator"
         },
         {
          "value": "solar-panel",
          "text": "Solar panel"
         },
         {
          "value": "solar-appliance",
          "text": "Solar light, radio or TV kit"
         }
        ]
       },
       {
        "type": "dropdown",
        "name": "ecs:itemVariant",
        "visibleIf": "{panel.ecs:accessoryType} anyof ['combustion-chamber','stove-mechanical-part','stove-housing-part','control-pcb','power-supply-cable','solar-panel','solar-appliance']",
        "title": "Which one exactly?",
        "description": "If you cannot find it in the list, choose the last answer and write what it is.",
        "isRequired": true,
        "choices": [
         {
          "value": "large",
          "text": "Burning chamber - large"
         },
         {
          "value": "medium",
          "text": "Burning chamber - medium"
         },
         {
          "value": "small",
          "text": "Burning chamber - small"
         },
         {
          "value": "chamber-plate",
          "text": "Metal part - chamber plate"
         },
         {
          "value": "chamber-removal-tool",
          "text": "Metal part - chamber removal tool"
         },
         {
          "value": "flame-spreader",
          "text": "Metal part - flame spreader"
         },
         {
          "value": "pot-rest",
          "text": "Metal part - pot rest"
         },
         {
          "value": "top-lid",
          "text": "Metal part - top lid"
         },
         {
          "value": "front-housing",
          "text": "Cover - front"
         },
         {
          "value": "back-housing",
          "text": "Cover - back"
         },
         {
          "value": "fan-box",
          "text": "Cover - fan box"
         },
         {
          "value": "fan-cover",
          "text": "Cover - fan cover"
         },
         {
          "value": "battery-cover",
          "text": "Cover - battery cover"
         },
         {
          "value": "knob",
          "text": "Knob"
         },
         {
          "value": "gen-2",
          "text": "Control board - Generation 2"
         },
         {
          "value": "gen-3",
          "text": "Control board - Generation 3"
         },
         {
          "value": "regulator",
          "text": "Power - regulator"
         },
         {
          "value": "usb-cable",
          "text": "Power - USB cable"
         },
         {
          "value": "usb-charger",
          "text": "Power - USB charger"
         },
         {
          "value": "stove-panel-10wp",
          "text": "Solar panel - for a stove (big)"
         },
         {
          "value": "stove-panel-small",
          "text": "Solar panel - for a stove (small)"
         },
         {
          "value": "appliance-spare-home60",
          "text": "Solar panel - spare for Sun King Home 60"
         },
         {
          "value": "appliance-spare-home120",
          "text": "Solar panel - spare for Sun King Home 120"
         },
         {
          "value": "biolite-solarhome-620",
          "text": "BioLite SolarHome 620"
         },
         {
          "value": "sunking-home-60",
          "text": "Sun King Home 60 (full kit)"
         },
         {
          "value": "sunking-home-120",
          "text": "Sun King Home 120 (full kit)"
         },
         {
          "value": "sunking-pico",
          "text": "Sun King Pico"
         },
         {
          "value": "sunking-pro",
          "text": "Sun King Pro"
         },
         {
          "value": "sunking-boom",
          "text": "Sun King Boom"
         },
         {
          "value": "sunking-radio",
          "text": "Sun King Radio"
         },
         {
          "value": "sunking-charge",
          "text": "Sun King Charge"
         },
         {
          "value": "sunking-40z",
          "text": "Sun King 40z"
         },
         {
          "value": "sunking-tv-kit",
          "text": "Sun King TV Kit"
         },
         {
          "value": "futura-es-plus",
          "text": "Futura ES Plus"
         },
         {
          "value": "lumi-charge",
          "text": "Lumi Charge"
         },
         {
          "value": "lumi-spark",
          "text": "Lumi Spark"
         }
        ],
        "choicesVisibleIf": "({panel.ecs:accessoryType} = 'combustion-chamber' and {item} anyof ['large','medium','small']) or ({panel.ecs:accessoryType} = 'stove-mechanical-part' and {item} anyof ['chamber-plate','chamber-removal-tool','flame-spreader','pot-rest','top-lid']) or ({panel.ecs:accessoryType} = 'stove-housing-part' and {item} anyof ['front-housing','back-housing','fan-box','fan-cover','battery-cover','knob']) or ({panel.ecs:accessoryType} = 'control-pcb' and {item} anyof ['gen-2','gen-3']) or ({panel.ecs:accessoryType} = 'power-supply-cable' and {item} anyof ['regulator','usb-cable','usb-charger']) or ({panel.ecs:accessoryType} = 'solar-panel' and {item} anyof ['stove-panel-10wp','stove-panel-small','appliance-spare-home60','appliance-spare-home120']) or ({panel.ecs:accessoryType} = 'solar-appliance' and {item} anyof ['biolite-solarhome-620','sunking-home-60','sunking-home-120','sunking-pico','sunking-pro','sunking-boom','sunking-radio','sunking-charge','sunking-40z','sunking-tv-kit','futura-es-plus','lumi-charge','lumi-spark'])",
        "showOtherItem": true,
        "otherText": "Not in this list - I will write it"
       },
       {
        "type": "text",
        "name": "ecs:batchID",
        "visibleIf": "{panel.ecs:itemCategory} = 'pellets' or ({panel.ecs:itemCategory} anyof ['component','accessory','appliance'] and {panel.ecs:accessoryType} anyof ['combustion-chamber','stove-mechanical-part','stove-housing-part','fan','battery','power-supply-cable','solar-panel'])",
        "title": "Number printed on the bag or box",
        "description": "Look on the pellet bag, or on the part's box. If there is no number, write None.",
        "isRequired": true
       },
       {
        "type": "text",
        "name": "schema:serialNumber",
        "visibleIf": "{panel.ecs:accessoryType} anyof ['control-pcb','solar-appliance']",
        "title": "Serial number of the PART you are delivering",
        "description": "The number printed on the part or its box.",
        "isRequired": true
       },
       {
        "type": "radiogroup",
        "name": "ecs:condition",
        "visibleIf": "{panel.ecs:itemCategory} = 'stove' or {panel.ecs:itemCategory} anyof ['component','accessory','appliance']",
        "title": "Is it new or used?",
        "isRequired": true,
        "choices": [
         {
          "value": "New",
          "text": "New"
         },
         {
          "value": "Pre-owned",
          "text": "Used (second hand)"
         }
        ]
       },
       {
        "type": "radiogroup",
        "name": "ecs:fitmentRelation",
        "visibleIf": "{panel.ecs:itemCategory} anyof ['component','accessory','appliance']",
        "title": "Is this item for a stove?",
        "description": "If it replaces a broken part, choose that answer.",
        "isRequired": true,
        "choices": [
         {
          "value": "standalone",
          "text": "No - it is not for a stove"
         },
         {
          "value": "replacement-for",
          "text": "Yes - it replaces a broken part"
         },
         {
          "value": "component-of",
          "text": "Yes - it is a part fitted inside a stove"
         },
         {
          "value": "accessory-to",
          "text": "Yes - it is used with a stove"
         },
         {
          "value": "bundled-with",
          "text": "Yes - it was sent with a new stove"
         }
        ]
       },
       {
        "type": "text",
        "name": "ecs:stoveSerialNumber",
        "visibleIf": "{panel.ecs:itemCategory} = 'stove' or ({panel.ecs:itemCategory} anyof ['component','accessory','appliance'] and {panel.ecs:fitmentRelation} notempty and {panel.ecs:fitmentRelation} <> 'standalone')",
        "title": "Serial number of the STOVE",
        "description": "The long number on the sticker under the stove. If you are delivering a part, this is the stove it goes into.",
        "isRequired": true
       },
       {
        "type": "text",
        "name": "schema:quantity_bags",
        "title": "How many?",
        "description": "For pellets, the number of bags.",
        "isRequired": true
       }
      ],
      "panelCount": 1,
      "minPanelCount": 1,
      "maxPanelCount": 20,
      "addPanelText": "Add another item",
      "removePanelText": "Remove this item"
     },
     {
      "type": "comment",
      "name": "schema:description",
      "title": "Anything we should know? (optional)",
      "description": "For example: a bag was damaged, or the customer was not at home.",
      "rows": 3
     }
    ],
    "title": "What did you deliver?",
    "description": "Add one block for each item. Tap 'Add another item' if there is more than one thing."
   },
   {
    "name": "delivery_confirmation",
    "elements": [
     {
      "type": "html",
      "name": "ixo:instruction",
      "html": "<p>Ask the customer for the <strong>4-digit PIN</strong> they got on their phone. Type it in below. This proves they received the delivery.</p>"
     },
     {
      "type": "text",
      "name": "ixo:oneTimePin",
      "title": "Customer's ONE TIME PIN",
      "description": "The customer will provide you a OTP, input it here",
      "isRequired": true,
      "inputType": "number",
      "maxLength": 4
     }
    ],
    "title": "Confirm with the customer"
   }
  ],
  "questionErrorLocation": "bottom",
  "showProgressBar": true,
  "progressBarLocation": "top",
  "pagePrevText": "Back",
  "pageNextText": "Next",
  "completeText": "Submit delivery claim",
  "showPreviewBeforeComplete": true
 }
}