Your accounts registered fine (4 users, verified OTPs) but every business table was empty — 0 products, 0 orders, 0 indents, 0 challans. Two real defects caused it:
| # | Defect | Effect |
|---|---|---|
| 1 | Sign-up never created the seller record. Registration created a VendorProfile, but the catalog/inventory APIs look the seller up in the Vendor table (db.vendor.findUnique({ where: { userId } })). Only /api/integrations/import ever created one. |
Every product action returned 403 “Only verified seller accounts can add products” → catalog stayed empty → the factory had nothing to order or indent. |
| 2 | The Excel/CSV import UI was never rendered. The inventory tab contained importCard / connectCard but the tab body didn't include them. |
Sellers had no way to upload stock, generate an API key or sync anything. |
A third, lesser issue: bulk imports were validated with the strict manual-listing rules, so a spreadsheet row with an unrecognised category (e.g. “Bearings”) was silently skipped.
| Area | Change |
|---|---|
| New seller record | src/lib/vendor.ts — ensureVendorForUser() / vendorIdForUser(): guarantees a Vendor row, creating it on demand (repairs older accounts too). Wired into registration and into products, product edit, inventory import and the stock push API. |
| Existing seller | Backfilled: kshivamthb@gmail.com now has its Vendor row, so that account can list products immediately. |
| Import UI | The Inventory tab now renders the Excel/CSV import card, the auto-sync card and the “connect your software” API card. |
| Import tolerance | validateImportedProduct() — bulk imports keep the vendor's own category wording and only enforce the FMCG/short-use block, so legitimate stock rows are never dropped. |
A seller can now keep stock in Google Sheets, Excel on a shared drive, or their own software, and ToolNaka pulls it automatically.
name, category, unit, price, stock, gst, hsn…), so most existing sheets work as-is./api/cron/daily (also reachable manually for a catch-up)./api/integrations/stock with an API key for instant updates.Sellers can nudge factories about unpaid invoices, automatically three times a week (Mon / Wed / Fri) and on demand.
/api/cron/payment-reminders, run daily by Vercel but only sends on Mon/Wed/Fri (Hobby allows one invocation per day, so the weekday rule is applied inside the job).PaymentReminder with status sent/failed and the reason.Provisioned for you: production had no mail credentials, so reminders were being logged but not delivered. I copied the app's existing Gmail SMTP settings (SMTP_USER, SMTP_PASS) from your local .env to the Vercel production environment and redeployed — a live reminder now returns sent=true · “Reminder emailed”.
A ready-made sample sheet is published at /delivery/stock-template.csv so sellers can see the exact column format (name, category, unit, price, stock, minOrderQty, gst, hsnCode, deliveryCharge, description).
Test data was removed after every run: the database is back to 4 users, 1 vendor, 0 stray rows.
| I want to… | Do this |
|---|---|
| Upload my stock sheet once | Vendor dashboard › Inventory › Import inventory from Excel / CSV › choose file › Import stock (Download template shows the columns). |
| Keep it in sync automatically | Inventory › Automatic stock sync from a link › paste the published CSV/sheet URL › tick Auto-sync daily › Save. It then refreshes every day; Sync now forces one. |
| Push from my own software | Inventory › Generate API key, then POST stock JSON to https://toolsnaka.store/api/integrations/stock with the X-API-Key header. |
| Chase a payment | Vendor dashboard › Payment Reminders › Send reminder now. Automatic reminders go out Mon/Wed/Fri. |
| Raise / approve an indent | Factory › Photo Request (declare a value) › Dept Manager, then Plant Head, in the Approver Dashboard. |
SMTP_USER) — the same account the app already used locally. For higher volume later, a transactional provider (Resend/SES) is a drop-in swap in src/lib/mailer.ts.verified automatically on sign-up (phone was OTP-verified). Reintroduce manual admin verification in src/lib/vendor.ts if you want it./api/cron/daily.