₹500 Hybrid Track
PartialUnder ₹500: Postgres only. ₹500+: open-box AI + 3 Polygon writes (~45–60 paise/order).
Sec 12 — Hybrid Logic
EC Module · Polygon PoS
v3 spec: 15-step order lifecycle, ₹500+ secure track (open-box + 3 writes), async BullMQ → Polygon. Integrated with hospitalnode.in cart, Razorpay, and delivery — on-chain layer planned until 2,000 orders/month trigger.
Integration: 72% · API: /api/blockchain/status
Secure threshold
₹500+
Open-box + 3 Polygon writes
Cost per secure order
45–60 paise
Auto-activate at
2,000 orders/mo
Chain
Polygon PoS
SHA-256 only — no PII on-chain
| # | Phase | Action | Chain | Status |
|---|---|---|---|---|
| 1 | CUSTOMER | Search medicine / lab /shop?view=paramedics&service=pharmacyGET /api/products | — | Live |
| 2 | CUSTOMER | Add to cart + stock check /cartPOST /api/orders (inventory verify) | — | Live |
| 3 | CUSTOMER | Rx upload for Schedule H drugs /shop?view=aiPOST /api/shop/hospital-ai/rx | — | Partial |
| 4 | CUSTOMER | Checkout — address + payment method /checkoutPOST /api/orders | — | Live |
| 5 | PAYMENT | UPI / card / webhook confirm POST /api/payments/razorpay/webhook | — | Live |
| 6 | WAREHOUSE | Pick + pack + dispatch PUT /api/vendor/... dispatch | WRITE1 | Partial |
| 7 | DELIVERY | Pickup QR handover /customer/track-orderPOST /api/delivery/scan-pickup | WRITE2 | Partial |
| 8 | DELIVERY | GPS tracking en route | — | Partial |
| 9 | DELIVERY | Doorstep arrival | — | Partial |
| 10 | OPEN-BOX | Open-box scan (≥₹500) | — | |
| 11 | OPEN-BOX | Match / mismatch verdict — descoped from pilot (OPEN_BOX_AI_ENABLED) | — | |
| 12 | DELIVERY | OTP delivery confirm POST /api/phlebo/... (lab) · order confirm | — | Partial |
| 13 | BLOCKCHAIN | Polygon Write 3 — final audit hash BullMQ blockchain:worker + AuditLog.sol | WRITE3 | Partial |
| 14 | COMMISSION | VHG / vendor commission payout | — | Gap |
| 15 | NOTIFY | SMS / WhatsApp all parties | — | Partial |
Under ₹500: Postgres only. ₹500+: open-box AI + 3 Polygon writes (~45–60 paise/order).
Sec 12 — Hybrid Logic
Write 1 dispatch (pack QR) · Write 2 pickup · Write 3 delivery confirm — BullMQ + AuditLog.sol.
ORDER_LIFECYCLE steps 6–13
SHA-256 hashes only on-chain — no PII. ethers.js + async BullMQ queue.
Polygon PoS architecture
Descoped from Patna pilot. Doorstep camera match — enable via OPEN_BOX_AI_ENABLED when ready.
Steps 10–11
EncounterRecord struct: patientHash + doctorHash + pharmacyHash + prescriptionRoot.
claude- Blockchain Architec.txt
GOVERNMENT_AUDITOR_ROLE + INSURANCE_VALIDATOR_ROLE — claim verify on-chain.
Smart contract RBAC
Payment webhook → inventory deduct → weekly VHG payout batch.
Sec 16 — Payment Flow
Redis counter → admin activates blockchainLogger.js when scale threshold hit.
HYBRID_LOGIC trigger
GET /api/products · GET /api/products/:id
POST /api/orders · GET /api/orders
POST /api/payments/razorpay/create-order · POST /api/payments/razorpay/webhook
GET /customer/track-order · phlebo assignments
GET /api/blockchain/status · npm run blockchain:worker
GET audit log by order hash (planned)
Polygon log = electronic record (65B)
Only SHA-256 on chain — no PII/video
Open-box + audit trail
Online pharmacy licence required for VHG