{
  "@context": {
    "ixo": "https://w3id.org/ixo/ns/protocol/",
    "@id": "@type",
    "type": "@type",
    "@protected": true
  },
  "type": "ixo:entity#surveyTemplate",
  "question": {
    "title": "Stock Movement Form",
    "description": "Capture stock movements including additions, transfers, adjustments, and stock counts.",
    "pages": [
      {
        "name": "stock_movement_details",
        "elements": [
          {
            "type": "panel",
            "name": "source_collection_panel",
            "elements": [
              {
                "type": "dropdown",
                "name": "ecs:collection_country",
                "title": "Collection Country",
                "isRequired": true,
                "choices": [
                  "Zambia",
                  "Malawi",
                  "Mozambique"
                ]
              },
              {
                "type": "dropdown",
                "name": "ecs:collection_type",
                "title": "Collection Type",
                "isRequired": true,
                "choices": [
                  "Depot",
                  "Supa Partner",
                  "Warehouse",
                  "Reseller",
                  "Mobile"
                ]
              },
              {
                "type": "text",
                "name": "ecs:collection",
                "title": "Collection",
                "description": "Specify the exact collection point (e.g., name or code)",
                "isRequired": true
              }
            ],
            "title": "Source Collection Details"
          },
          {
            "type": "panel",
            "name": "movement_details_panel",
            "elements": [
              {
                "type": "dropdown",
                "name": "ecs:type",
                "title": "Transaction Type",
                "isRequired": true,
                "choices": [
                  "Add",
                  "Transfer Out",
                  "Adjustment Increase",
                  "Adjustment Decrease",
                  "Stock Count"
                ]
              },
              {
                "type": "dropdown",
                "name": "ecs:adjustment_reason",
                "visibleIf": "{ecs:type} = 'Adjustment Increase' or {ecs:type} = 'Adjustment Decrease'",
                "title": "Adjustment Reason",
                "description": "Specify the reason for stock adjustment",
                "isRequired": true,
                "choices": [
                  "Theft",
                  "Damage",
                  "Rebate",
                  "Rebagging",
                  "Demonstration",
                  "Write-off",
                  "Internal Use",
                  "Other"
                ]
              },
              {
                "type": "comment",
                "name": "ecs:note",
                "title": "Note",
                "description": "Optional notes or explanation for this transaction"
              }
            ],
            "title": "Movement Details"
          },
          {
            "type": "panel",
            "name": "destination_panel",
            "elements": [
              {
                "type": "dropdown",
                "name": "ecs:destination_collection_country",
                "title": "Destination Country",
                "isRequired": true,
                "choices": [
                  "Zambia",
                  "Malawi",
                  "Mozambique"
                ]
              },
              {
                "type": "dropdown",
                "name": "ecs:destination_collection_type",
                "title": "Destination Collection Type",
                "isRequired": true,
                "choices": [
                  "Depot",
                  "Supa Partner",
                  "Warehouse",
                  "Reseller",
                  "Mobile"
                ]
              },
              {
                "type": "text",
                "name": "ecs:destination_collection",
                "title": "Destination Collection",
                "isRequired": true
              }
            ],
            "visibleIf": "{ecs:type} = 'Transfer Out'",
            "title": "Destination Details (Transfer Only)"
          },
          {
            "type": "panel",
            "name": "stock_item_panel",
            "elements": [
              {
                "type": "dropdown",
                "name": "ecs:stock_item_type",
                "title": "Stock Item Type",
                "isRequired": true,
                "choices": [
                  "Pellets",
                  "Accessory"
                ]
              },
              {
                "type": "text",
                "name": "ecs:stock_item",
                "title": "Stock Item",
                "description": "Specify the exact stock item name or SKU",
                "isRequired": true
              },
              {
                "type": "text",
                "name": "ecs:quantity",
                "title": "Quantity",
                "isRequired": true,
                "inputType": "number"
              }
            ],
            "title": "Stock Item Details"
          }
        ]
      }
    ],
    "completeText": "Submit Stock Movement"
  }
}