ToolNaka · release

Vendor Oversight for Department Heads

See every seller supplying your factory, and act when something looks wrong — flag it, or block it so no new orders can be placed until you lift the block.

Live on toolsnaka.store 13/13 local + 13/13 live Server-side enforcement

What it does

In the Approver Dashboard (department head or plant head login) there is a new section, “Vendors you buy from”. It lists every seller that has supplied your factory, sorted by volume, with the money and order history behind each one — and it puts the control in your hands.

CapabilityBehaviour
See every sellerName, city, order count, total value, last order (number + date), and the current state: normal, flagged or blocked — with the reason and when it was set.
FlagMarks the seller as questionable. Requires a written reason. The seller is notified.
BlockPhysically stops the factory from ordering from that seller. Checkout returns 403 “This seller is blocked by your department head (reason). New orders are paused until it is lifted.” Requires a written reason. The seller is notified.
Clear / UnblockLifts a flag or a block; ordering resumes immediately.
HistoryEvery action is stored with who took it, when, why, and the seller's state at that moment — the last five are shown on the vendor.
Guard railsOnly department heads, plant heads and ToolNaka admins can act. A seller cannot read the oversight list (403). Flag/block without a reason is rejected (400). A seller with no orders to your factory cannot be acted on (404).

Where it lives

Log in as a department head or plant head → Approval Desk → scroll to “Vendors you buy from”. The section sits between the approval queue and the status-flow reference, and shows counters for sellers / flagged / blocked.

API: GET /api/vendor-oversight (role-scoped list) · POST /api/vendor-oversight (record an action) · block enforcement in POST /api/orders. Data model: VendorAction.

Design decisions

Verification — 13/13, run twice

$ node .e2e-oversight.cjs (run 1: local server · run 2: https://toolsnaka.store) PASS demo accounts can log in (dept head / factory / vendor) PASS dept head sees vendors with their order volume vendors=1 PASS the vendor shows orders + value Demo Industrial Supplies: 1 orders, ₹1,850 PASS vendor cannot read the oversight list 403 PASS dept head can flag a vendor 201 PASS vendor shows as flagged state=flagged PASS flag/block requires a reason 400 PASS dept head can block a vendor 201 PASS factory CANNOT order from a blocked vendor 403 PASS dept head can unblock a vendor 201 PASS factory can order again after the block 201 PASS state returns to normal after clearing state=normal PASS action history recorded on the vendor history=4 === 13/13 checks passed ===

Run 2 was executed against https://toolsnaka.store with the same database the real users hit. All test rows were deleted afterwards — vendorAction rows left: 0.

How to use it

To…Do this
Review a sellerApprover Desk → “Vendors you buy from” → read the row: orders, value, last order, state.
Raise a concernPress Flag, type the reason, press Flag again. The seller is notified; the state turns amber.
Stop a sellerPress Block, type the reason, confirm. New orders from your factory to that seller are refused immediately.
Restore a sellerClear (lifts a flag) or Unblock (lifts a block). Ordering resumes at once.

Notes