{
 "prompt": "insufficient funds",
 "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"
    }
   }
  },
  "/reports/ageing": {
   "body": {
    "rows": [
     {
      "customer_id": "01C1",
      "name": "Sunita Pawar",
      "mobile": "9867045512",
      "outstanding": 4200.0,
      "oldest_days": 112,
      "credit_limit": 20000
     },
     {
      "customer_id": "01C2",
      "name": "Ramesh Shah",
      "mobile": "9820011111",
      "outstanding": 900.0,
      "oldest_days": 12,
      "credit_limit": 10000
     }
    ]
   }
  },
  "/customers/credit": {
   "body": {
    "customer": {
     "id": "01C1",
     "name": "Sunita Pawar",
     "mobile": "9867045512",
     "credit_limit": 20000,
     "credit_days": 30
    },
    "outstanding": 4200.0,
    "oldest_days": 112,
    "open_bills": [
     {
      "bill_no": "C1/2026-27/000012",
      "bill_date": "2026-05-10",
      "due": 4200.0
     }
    ],
    "decision": {
     "allow": false,
     "reason": "oldest bill is 112 days old"
    },
    "receipts": [
     {
      "id": "01R1",
      "receipt_no": "R/0001",
      "receipt_date": "2026-08-01",
      "amount": 1000.0,
      "mode": "CHEQUE",
      "instrument_no": "004417",
      "clearing_status": "PENDING",
      "bounced_reason": null
     }
    ]
   }
  },
  "/receipts": {
   "body": {
    "receipt_no": "R/0002"
   }
  },
  "/receipts/clear": {
   "body": {
    "ok": true
   }
  },
  "/receipts/bounce": {
   "body": {
    "ok": true
   }
  },
  "/customers/statement": {
   "body": {
    "lines": [
     {
      "dt": "2026-05-10",
      "ref": "C1/2026-27/000012",
      "kind": "Bill",
      "debit": 4200.0,
      "credit": 0
     },
     {
      "dt": "2026-08-01",
      "ref": "R/0001",
      "kind": "Receipt",
      "debit": 0,
      "credit": 1000.0
     }
    ]
   }
  },
  "/consent": {
   "body": {
    "events": [
     {
      "purpose": "MARKETING",
      "action": "GRANTED",
      "source": "COUNTER",
      "created_at": "2026-05-02 11:20:00"
     }
    ]
   }
  },
  "/consent/erase": {
   "body": {
    "ok": true,
    "bills_retained": 2,
    "message": "The person is erased. 2 bill(s) are retained without a name."
   }
  },
  "/loyalty/balance": {
   "body": {
    "enabled": true,
    "balance": 420,
    "expiring_soon": 80
   }
  },
  "/loyalty/statement": {
   "body": {
    "entries": [
     {
      "entry_type": "EARN",
      "points": 45,
      "created_at": "2026-08-30 10:12:00"
     },
     {
      "entry_type": "REDEEM",
      "points": -200,
      "created_at": "2026-08-12 17:40:00"
     }
    ]
   }
  }
 },
 "steps": [
  {
   "name": "sign in",
   "fill": {
    "lpw": "x"
   },
   "click": "btnLogin",
   "wait": 400,
   "expect": {
    "shopName": "Shree Krishna Medical"
   }
  },
  {
   "name": "MONEY AT RISK IS SHOWN FIRST",
   "wait": 250,
   "expect": {
    "r90": "4,200.00"
   }
  },
  {
   "name": "oldest first",
   "wait": 50,
   "expect": {
    "body": "112 days"
   }
  },
  {
   "name": "open a customer",
   "call": "openCust",
   "args": [
    "01C1"
   ],
   "wait": 350,
   "expect": {
    "side": "Do not extend more credit"
   }
  },
  {
   "name": "an uncleared cheque is marked PENDING",
   "wait": 50,
   "expect": {
    "side": "PENDING"
   }
  },
  {
   "name": "the statement can be produced",
   "call": "showStatement",
   "wait": 350,
   "expect": {
    "stmt": "C1/2026-27/000012"
   }
  },
  {
   "name": "CONSENT IS VISIBLE WHERE THE CUSTOMER IS",
   "wait": 350,
   "expect": {
    "consentRow": "MARKETING"
   }
  }
 ]
}