{
  "schema_version": 1,
  "workflow_id": 8,
  "slug": "pos-restock-alert",
  "purpose": "Synthetic test data and expected results used to run this workflow in a Shopify development store. Replace every value with your own store data before testing.",
  "environment": "Shopify development store, Basic plan, one location",
  "test_data": {
    "NIKE | SWOOSH PRO FLAT PEAK CAP": "1 variant at the selected location: 4 -> 3 -> 2 -> 6, then restored to 4",
    "NIKE | TODDLER ROSHE ONE size 4": "13 -> 12, then restored to 13"
  },
  "configuration_under_test": {
    "trigger": "Product variant inventory quantity changed",
    "alert_condition": "ANY inventoryLevel (available <= 5 AND location.id == configured location) AND NONE variant metafield (flow_stock.variant_out_of_stock == true)",
    "alert_actions": "Send internal email to ops@example.com 'Restock needed: {{product}} - {{variant}}'; set variant metafield flow_stock.variant_out_of_stock = true",
    "restocked_condition": "ANY inventoryLevel (available >= 6 AND location.id == configured location) AND ANY variant metafield (flow_stock.variant_out_of_stock == true)",
    "restocked_actions": "Send internal email 'Restocked: {{product}} - {{variant}}'; set variant metafield flow_stock.variant_out_of_stock = false"
  },
  "planned_cases": [
    {
      "case": "selected location low",
      "setup": "Selected location available at or below threshold",
      "expected": "Send alert"
    },
    {
      "case": "different location low",
      "setup": "Only another location is at or below threshold",
      "expected": "No alert"
    },
    {
      "case": "selected location healthy",
      "setup": "Selected location above threshold",
      "expected": "No alert"
    },
    {
      "case": "missing configured location",
      "setup": "No inventoryLevels entry matches the location ID",
      "expected": "No alert; surface configuration issue"
    }
  ],
  "executed_cases": [
    {
      "case": "selected location low",
      "event": "Cap available 4 -> 3, variant had no flow_stock metafield",
      "expected": "Send alert"
    },
    {
      "case": "repeat below threshold",
      "event": "Cap available 3 -> 2",
      "expected": "No repeat alert"
    },
    {
      "case": "restocked",
      "event": "Cap available 2 -> 6",
      "expected": "Send restocked email and reset"
    },
    {
      "case": "selected location healthy",
      "event": "ROSHE size 4 available 13 -> 12",
      "expected": "No alert"
    }
  ],
  "not_executed_cases": [
    {
      "case": "different location low",
      "reason": "The test store has one location."
    },
    {
      "case": "missing configured location",
      "reason": "Not run. With no matching inventory level, both ANY conditions are false by construction, so no email is sent; the workflow does not report the configuration issue."
    }
  ],
  "evidence_file": "evidence/pos-restock-alert.run-evidence.json"
}
