[Issue]: Add Vendor-ID to /inventory/vendors search #57

Closed
opened 2026-06-21 07:05:49 +00:00 by shad0w · 3 comments
Owner

Raised by

Kaushal Pal Singh (kps@pelagiamarine.com, MANAGER) — via portal Report Issue button

Description

Allow vendors on purchasing /inventory/vendors screen to be searchable by vendor id. Also make the ID show up next to the name (same column)

Priority

P2 — Medium

Context

  • Page: /inventory/vendors
  • Reported at: 2026-06-21T07:05:49.158Z
### Raised by Kaushal Pal Singh (kps@pelagiamarine.com, MANAGER) — via portal Report Issue button ### Description Allow vendors on purchasing /inventory/vendors screen to be searchable by vendor id. Also make the ID show up next to the name (same column) ### Priority P2 — Medium ### Context - Page: `/inventory/vendors` - Reported at: 2026-06-21T07:05:49.158Z
shad0w added the
portal
label 2026-06-21 07:05:49 +00:00
shad0w added the
feature
claude-queue
triaged
labels 2026-06-21 07:10:58 +00:00
Author
Owner

Claude triage

Triage — Issue #57: Add Vendor-ID to /inventory/vendors search

Type: Feature (enhancement to existing search + display behaviour)
Routing: claude-queue
Priority: P2 — Medium

Request interpretation

Kaushal (Manager) wants two things on the purchasing Vendors screen (/inventory/vendors):

  1. Searchable by vendor id — the search box should match against a vendor's vendorId (the formal verified vendor code), in addition to the existing name / GSTIN / address matching.
  2. Show the ID next to the name — render the vendorId in the same column as the vendor name.

Key finding — the data is already there

vendorId is already queried and threaded into the table rows:

  • App/app/(portal)/inventory/vendors/page.tsx:55vendorId: v.vendorId ?? null is already on each row.
  • App/app/(portal)/inventory/vendors/vendors-table.tsx:11VendorRow.vendorId: string | null is already in the row type.

So no server/DB/query changes are neededvendorId is unused in the client component today. This is a pure client-side presentation/filter change in one file.

Concrete action items

  1. Add vendorId to the search filtervendors-table.tsx:41-46, in the filtered useMemo. Add a clause like (v.vendorId && v.vendorId.toLowerCase().includes(q)) alongside the existing name/gstin/address checks.
  2. Display the ID next to the namevendors-table.tsx:149-160, inside the "Vendor" cell. Render vendor.vendorId adjacent to the <Link> name (e.g. a muted/mono badge or trailing text). Handle the null case gracefully (omit, don't render an em-dash, since many vendors are unverified and have no vendorId).
  3. Update the search placeholdervendors-table.tsx:92, placeholder="Search by name, GSTIN or address…" → include "ID" so users discover the new capability.

Files / areas involved

  • App/app/(portal)/inventory/vendors/vendors-table.tsx — the only file expected to change (client component: filter, Vendor cell, placeholder text).
  • App/app/(portal)/inventory/vendors/page.tsx — read-only confirmation that vendorId is already supplied; no change anticipated.

Open questions (non-blocking; sensible defaults assumed)

  • "Vendor id" = which field? Assumed the formal Vendor.vendorId (the verified vendor code, per CLAUDE.md "Vendors" section), not the internal cuid id. This is the natural reading and the field already on the row.
  • Display when vendorId is null: unverified vendors have no vendorId. Default: simply omit it for those rows rather than showing a placeholder.
  • Styling: exact visual treatment (mono badge vs. plain muted suffix) is a minor cosmetic choice; follow existing patterns in the cell (e.g. the verified badge / mono GSTIN styling).

Verifiability

  • pnpm type-check and pnpm lint cover correctness of the single-file change.
  • No DB migration, no auth/permissions, no payments, no external systems, no schema change. Localized to one client component with data already plumbed through.

Routing rationale: Localized single-file client-side change (filter + display) with the required vendorId data already passed to the component, clear acceptance criteria, and no DB/auth/payments/external-system involvement — safely automatable and verifiable by type-check/lint.

Routing: claude-queue | Type: feature

## Claude triage # Triage — Issue #57: Add Vendor-ID to /inventory/vendors search **Type:** Feature (enhancement to existing search + display behaviour) **Routing:** claude-queue **Priority:** P2 — Medium ## Request interpretation Kaushal (Manager) wants two things on the purchasing **Vendors** screen (`/inventory/vendors`): 1. **Searchable by vendor id** — the search box should match against a vendor's `vendorId` (the formal verified vendor code), in addition to the existing name / GSTIN / address matching. 2. **Show the ID next to the name** — render the `vendorId` in the same column as the vendor name. ## Key finding — the data is already there `vendorId` is already queried and threaded into the table rows: - `App/app/(portal)/inventory/vendors/page.tsx:55` — `vendorId: v.vendorId ?? null` is already on each row. - `App/app/(portal)/inventory/vendors/vendors-table.tsx:11` — `VendorRow.vendorId: string | null` is already in the row type. So **no server/DB/query changes are needed** — `vendorId` is unused in the client component today. This is a pure client-side presentation/filter change in one file. ## Concrete action items 1. **Add `vendorId` to the search filter** — `vendors-table.tsx:41-46`, in the `filtered` `useMemo`. Add a clause like `(v.vendorId && v.vendorId.toLowerCase().includes(q))` alongside the existing name/gstin/address checks. 2. **Display the ID next to the name** — `vendors-table.tsx:149-160`, inside the "Vendor" cell. Render `vendor.vendorId` adjacent to the `<Link>` name (e.g. a muted/mono badge or trailing text). Handle the `null` case gracefully (omit, don't render an em-dash, since many vendors are unverified and have no `vendorId`). 3. **Update the search placeholder** — `vendors-table.tsx:92`, `placeholder="Search by name, GSTIN or address…"` → include "ID" so users discover the new capability. ## Files / areas involved - `App/app/(portal)/inventory/vendors/vendors-table.tsx` — the only file expected to change (client component: filter, Vendor cell, placeholder text). - `App/app/(portal)/inventory/vendors/page.tsx` — read-only confirmation that `vendorId` is already supplied; no change anticipated. ## Open questions (non-blocking; sensible defaults assumed) - **"Vendor id" = which field?** Assumed the formal `Vendor.vendorId` (the verified vendor code, per CLAUDE.md "Vendors" section), not the internal cuid `id`. This is the natural reading and the field already on the row. - **Display when `vendorId` is null:** unverified vendors have no `vendorId`. Default: simply omit it for those rows rather than showing a placeholder. - **Styling:** exact visual treatment (mono badge vs. plain muted suffix) is a minor cosmetic choice; follow existing patterns in the cell (e.g. the verified badge / mono GSTIN styling). ## Verifiability - `pnpm type-check` and `pnpm lint` cover correctness of the single-file change. - No DB migration, no auth/permissions, no payments, no external systems, no schema change. Localized to one client component with data already plumbed through. Routing rationale: Localized single-file client-side change (filter + display) with the required `vendorId` data already passed to the component, clear acceptance criteria, and no DB/auth/payments/external-system involvement — safely automatable and verifiable by type-check/lint. **Routing:** `claude-queue` | **Type:** `feature`
shad0w added
claude-working
and removed
claude-queue
labels 2026-06-21 07:10:59 +00:00
Author
Owner

[Claude] Started working on this issue on branch claude/issue-57.

<!-- ppms-bot --> [Claude] Started working on this issue on branch `claude/issue-57`.
shad0w added
claude-pr
and removed
claude-working
labels 2026-06-21 07:13:31 +00:00
Author
Owner

[Claude] Opened PR #58 with a proposed fix. Review and merge it, then create a release tag to deploy.

<!-- ppms-bot --> [Claude] Opened PR [#58](https://git.pelagiamarine.com/shad0w/pelagia-portal/pulls/58) with a proposed fix. Review and merge it, then create a release tag to deploy.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: shad0w/pelagia-portal#57
No description provided.