ToolNaka — Live Fixes & New Seller Features

“All features not working” root-caused and fixed, plus spreadsheet stock sync and 3×/week payment reminders · 2026-09-19 · https://toolsnaka.store
Root cause fixed 17/17 + 14/14 + 8/8 checks passed Live on production

1. Why nothing worked

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:

#DefectEffect
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.

2. What was fixed

AreaChange
New seller recordsrc/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 sellerBackfilled: kshivamthb@gmail.com now has its Vendor row, so that account can list products immediately.
Import UIThe Inventory tab now renders the Excel/CSV import card, the auto-sync card and the “connect your software” API card.
Import tolerancevalidateImportedProduct() — bulk imports keep the vendor's own category wording and only enforce the FMCG/short-use block, so legitimate stock rows are never dropped.

3. New — automatic stock sync from a link

A seller can now keep stock in Google Sheets, Excel on a shared drive, or their own software, and ToolNaka pulls it automatically.

4. New — payment reminders, three times a week

Sellers can nudge factories about unpaid invoices, automatically three times a week (Mon / Wed / Fri) and on demand.

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”.

5. Verification

Full buyer-seller journey (17/17) — against the live database

PASS OTP send / verify (vendor, factory) PASS register vendor + register factory PASS Vendor row auto-created at signup status=verified PASS seller can add a product status=201 PASS product appears in the catalog PASS factory sees the seller in the marketplace count=2 PASS factory sees the product PASS factory can place an order TN-ORD-000001 PASS order produced an approval record auto_approved PASS factory can raise an indent routed to dept_manager, 2 levels PASS indent visible in the factory view === 17/17 checks passed ===

New features (14/14) — local run against the same database

PASS sync source saved + first pull 2 added, 0 updated, 0 skipped (2 rows) PASS changed stock reflected 5000 -> 4200 PASS new row added by the sync MS Plate 6mm, stock 900 PASS daily cron endpoint runs sync + reminders PASS outstanding balance shows 2360 for the factory PASS weekly schedule reported 3x (Mon/Wed/Fri) PASS send reminder now responds sent=true PASS reminder recorded with the amount 2360 / 1 invoice === 14/14 checks passed ===

Live on production (8/8) — https://toolsnaka.store

PASS /api/inventory/sync protected 401 PASS /api/payment-reminders protected 401 PASS /api/cron/daily protected 401 PASS new UI present in live bundle 7/7 strings found PASS seller can log in on production 200 PASS outstanding shown on production 2360 - schedule "Mon, Wed, Fri" PASS reminder send accepted sent=true - "Reminder emailed" PASS reminder recorded on production status=sent === 8/8 live checks passed ===

Live stock sync executed by production (9/9)

PASS sample stock sheet served on the live site HTTP 200 PASS seller logged in on production 200 PASS sync pulled from the live URL "4 added, 0 updated, 0 skipped (4 rows)" PASS all 4 spreadsheet rows landed created=4 PASS catalog has the synced products count=4 PASS stock + price captured correctly Hex Bolt 5000 @ 3.5 PASS other rows captured MS Plate 900 PASS products visible in the public catalog feed count=4 PASS panel reports the last sync "4 added, 0 updated, 0 skipped" === 9/9 live sync checks passed ===

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.

6. How to use it

I want to…Do this
Upload my stock sheet onceVendor dashboard › Inventory › Import inventory from Excel / CSV › choose file › Import stock (Download template shows the columns).
Keep it in sync automaticallyInventory › 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 softwareInventory › Generate API key, then POST stock JSON to https://toolsnaka.store/api/integrations/stock with the X-API-Key header.
Chase a paymentVendor dashboard › Payment Reminders › Send reminder now. Automatic reminders go out Mon/Wed/Fri.
Raise / approve an indentFactory › Photo Request (declare a value) › Dept Manager, then Plant Head, in the Approver Dashboard.

7. Notes and remaining choices