{
 "prompt": "distributor cannot supply",
 "responses": {
  "/auth/login": {
   "body": {
    "csrf": "tok",
    "user": {
     "role": "OWNER"
    }
   }
  },
  "/auth/me": {
   "body": {
    "user": {
     "full_name": "Prakash",
     "role": "OWNER"
    },
    "store": {
     "name": "Shree Krishna Medical"
    },
    "counter": {
     "code": "C1"
    }
   }
  },
  "/reorder/worklist": {
   "body": {
    "run_date": "2026-08-30",
    "items": [
     {
      "classification": "URGENT",
      "name": "Telmisartan 40mg",
      "supplier": "Thane Pharma",
      "on_hand_units": 30,
      "on_order_units": 0,
      "daily_velocity": 12,
      "days_of_stock": 2.5,
      "suggested_packs": 8,
      "expiry_capped": 0,
      "rationale": "2 days of stock, 9 day lead time"
     },
     {
      "classification": "REORDER",
      "name": "Paracetamol 650mg",
      "supplier": "Thane Pharma",
      "on_hand_units": 300,
      "on_order_units": 0,
      "daily_velocity": 20,
      "days_of_stock": 15,
      "suggested_packs": 10,
      "expiry_capped": 0,
      "rationale": "below reorder point"
     }
    ],
    "open_orders": [
     {
      "id": "01PO",
      "po_no": "PO/2026-27/0001",
      "po_date": "2026-08-28",
      "status": "SENT",
      "expected_on": "2026-09-05",
      "supplier": "Thane Pharma",
      "line_count": 3
     }
    ]
   }
  },
  "/reorder/order": {
   "body": {
    "order": {
     "po_no": "PO/2026-27/0001"
    },
    "lines": [
     {
      "line_no": 1,
      "item_name": "Telmisartan",
      "qty_packs": 8,
      "qty_units": 120,
      "qty_received": 0,
      "units_per_pack": 15
     }
    ]
   }
  },
  "/reorder/send": {
   "body": {
    "sent": true,
    "po_no": "PO/2026-27/0001"
   }
  },
  "/reorder/receive": {
   "body": {
    "status": "PART_RECEIVED",
    "lines_filled": 0,
    "lines_short": 1
   }
  },
  "/reorder/cancel": {
   "body": {
    "cancelled": true
   }
  },
  "/suppliers": {
   "body": {
    "suppliers": [
     {
      "id": "01SUP",
      "code": "TPD",
      "name": "Thane Pharma Distributors",
      "gstin": "27AABCT1234R1ZP"
     }
    ]
   }
  },
  "/returnable": {
   "body": {
    "batches": [
     {
      "batch_id": "01B1",
      "batch_no": "B-9911",
      "expiry_date": "2026-11-30",
      "mrp": 210.0,
      "purchase_rate": 160.0,
      "item_name": "Telmisartan 40mg",
      "units_per_pack": 15,
      "on_hand": 120,
      "days_left": 91
     },
     {
      "batch_id": "01B2",
      "batch_no": "B-4402",
      "expiry_date": "2026-07-31",
      "mrp": 33.0,
      "purchase_rate": 25.0,
      "item_name": "Paracetamol 650mg",
      "units_per_pack": 15,
      "on_hand": 45,
      "days_left": -30
     }
    ]
   }
  },
  "/debit-notes": {
   "body": {
    "dn_no": "DN/2026-27/0001",
    "net_amount": 1280.0
   }
  }
 },
 "steps": [
  {
   "name": "sign in",
   "fill": {
    "lpw": "x"
   },
   "click": "btnLogin",
   "wait": 400,
   "expect": {
    "shopName": "Shree Krishna Medical"
   }
  },
  {
   "name": "THE WORKLIST LOADS",
   "wait": 300,
   "expectRows": {
    "sel": "tbody tr",
    "count": 2
   }
  },
  {
   "name": "urgent is counted",
   "wait": 50,
   "expect": {
    "vUrg": "1"
   }
  },
  {
   "name": "the reason is shown",
   "wait": 50,
   "expect": {
    "body": "9 day lead time"
   }
  },
  {
   "name": "SEND-BACK LISTS NEAR-EXPIRY STOCK",
   "call": "show",
   "args": [
    "ret"
   ],
   "wait": 420,
   "expect": {
    "body": "B-9911"
   }
  },
  {
   "name": "and expired stock is shown as unclaimable",
   "wait": 150,
   "expect": {
    "body": "no credit"
   }
  }
 ]
}