# ToolNaka — Checkpoint Ledger

**Project:** ToolNaka (industrial B2B procurement) · repo `toolnaka-ai`
**Live:** https://toolsnaka.store (Vercel + Neon Postgres)
**Ledger updated:** 2026-09-22
**Verification basis:** every "done" row below has a named artifact or a live check; anything not proven is listed under *Open / unverified*.

Status key: **done** · **in progress** · **blocked** · **dropped**

| # | Work item | Status | Evidence |
|---|---|---|---|
| 1 | Fresh start — wiped all non-admin accounts + business data (admin + 19 pincodes kept) | done | `toolnaka-ai/backups/dev-2026-09-13T04-53-25-513Z.db`; note: 1 user after wipe |
| 2 | Rider/Delivery panel removed + backend role allowlist | done | `DELIVERY/toolnaka-hardening-handoff.html`; live: `POST /api/auth {role:"delivery"}` → **400 Invalid role** |
| 3 | Vendor service-request panel fixed (fake id → PATCH 500) | done | `DELIVERY/toolnaka-vercel-golive-report.html` |
| 4 | Uploads made DB-portable (`Upload` table, `/api/uploads/[name]`) | done | `prisma/schema.prisma` (model `Upload`), `src/app/api/part-requests/route.ts` |
| 5 | Monthly-bill job moved to a Vercel cron | done | `src/app/api/cron/monthly-bills/route.ts`, `vercel.json` (`0 3 * * *`) |
| 6 | Deploy to Vercel (production) | done | https://toolnaka.vercel.app · `api/health` 200 |
| 7 | Neon Postgres provisioned, schema pushed (37 tables), admin + pincodes seeded | done | `prisma db push` output; DB counts |
| 8 | DNS cutover `toolsnaka.store` + `www` → Vercel, TLS issued | done | `DELIVERY/toolnaka-vercel-golive-report.pdf`; records → `2276e30b6842de2e.vercel-dns-017.com`; `Server: Vercel` |
| 9 | Laptop server retired (watchdog + local server + tunnel stopped) | done | `DELIVERY/toolnaka-local-retire-notes.md`; port 3000 free, site still served by Vercel |
| 10 | Workflow-fit audit of the factory→vendor flow | done | `DELIVERY/toolnaka-workflow-fit-audit.pdf` (revision 1 gaps, revision 2 closed) |
| 11 | Gap closure: approval chain on the indent (dept → plant head), dept scoping, emergency bypass | done | `DELIVERY/toolnaka-workflow-fit-audit.pdf`; e2e 16/16 |
| 12 | Root cause of "all features not working": `Vendor` row never created at signup + import UI never rendered | done | `DELIVERY/toolnaka-live-fixes-and-features.pdf`; journey e2e **17/17** |
| 13 | Automatic stock sync from a link (Google Sheet/CSV/xlsx), daily cron | done | `src/lib/inventory-sync.ts`, `/api/inventory/sync`, `/api/cron/daily`; sync e2e **14/14**; live pull **9/9** |
| 14 | Payment reminders 3×/week (Mon/Wed/Fri) + SMTP provisioned on Vercel | done | `/api/payment-reminders`, `/api/cron/payment-reminders`; live send `sent=true "Reminder emailed"` |
| 15 | PIN code → area/city/district/state (India), cache-first | done | `/api/pincode`; live 200: 411001 Pune City · 302001 Jaipur · 110001 New Delhi |
| 16 | "Moglix" branding removed (labels, identifiers, comments) | done | 0 occurrences of `moglix` in `src` and in the **live** JS bundle |
| 17 | Direct catalog import entry in the Product Catalog tab | done | `src/components/toolnaka/VendorDashboard.tsx` (Import panel) |
| 18 | Delivery feature: factory chooses vendor vs ToolNaka; ToolNaka choice locked to the seller | done | `/api/deliveries`, `Order.deliveryMode`, `Delivery`+`DeliveryEvent`; delivery e2e **11/11**, live **9/9** |
| 19 | Resume / verification / handoff package (this document + dashboard) | done | `DELIVERY/toolnaka-resume-handoff.html` · status board: `DELIVERY/toolnaka-status-board.html`, `DELIVERY/toolnaka-checkpoint-ledger.md`, `DELIVERY/verification/verify-live.cjs` |
| 20 | Live demo on production - 5 real accounts (factory, dept head, plant head, seller, ToolNaka ops) and the full 23-step flow | done | `/delivery/toolnaka-live-demo.html`; run **23/23** |
| 21 | Signup OTP delivered by email - the code is no longer returned in the API response | done | `/api/otp`; live check `channel=email`, `demoCode` absent |
| 22 | Vendor oversight for department heads - see every seller supplying the factory with order volume; flag / block / unblock with a reason; blocked sellers are refused new orders | done | `/api/vendor-oversight`; oversight e2e **13/13** live |
| 23 | WhatsApp &amp; Meta Business Agent integration - automatic WhatsApp updates for orders, deliveries, payment reminders and vendor flags; inbound "status" replies; Meta Business Agent setup guide | done | `src/lib/whatsapp-cloud.ts`, `/api/whatsapp/webhook`, `/api/whatsapp/test`; e2e **12/12** local + live webhook handshake verified; guide at `/delivery/toolnaka-meta-whatsapp-setup.html` |
| 24 | Delivery fee charged to the order total at checkout | **not started** | flagged for confirmation — changes checkout pricing |
| 25 | Rider login (riders updating status from their phones) | **not started** | flagged for confirmation — adds a role back |

## Open / unverified

- **Delivery fee in the order total** — the job records a fee/distance but the checkout total does not include it. Needs your go-ahead (pricing change).
- **Rider login** — riders are currently *data* assigned by ToolNaka ops; there is no rider account. Needs your go-ahead (adds a role).
- **Real OTP provider** — signup works today via the mock provider (the OTP is returned to the client and logged). Add Fast2SMS/2Factor/MSG91/Twilio keys in Vercel to switch to real SMS; no code change needed.
- **Reminder email volume** — sends via your Gmail SMTP account. Fine for current volume; a transactional provider (Resend/SES) is a one-file swap in `src/lib/mailer.ts`.
- **PIN lookup source** — the first lookup for a new PIN calls the free India Post directory, then it is cached in `PincodeCoverage`. No offline bulk dataset is bundled.

## Dropped (intentionally, with reason)

- **Rider/Delivery login role** — removed earlier by request; the new delivery feature deliberately models riders as data so the role does not come back.
- **Local self-hosting** — replaced by Vercel + Neon; the laptop stack is stopped and documented in `toolnaka-local-retire-notes.md`.
- **Turso** as the database — abandoned for Neon (Prisma driver-adapter friction, no `db push`).

