Repository navigation
feat: add approved-vendor search and order-form approval badge - #49
Merged
Merged
Conversation
matejstastny
requested review from
CPrutean and
matejstastny
and removed request for
matejstastny
October 6, 2026 01:54
Import the supplier export into a new approved_vendors table with an FTS5 trigram index, and surface it two ways: a Search vendors dialog on the Orders page, and a live Approved / Out-of-scope badge under the vendor field in the order form. Approval = Supplier Status 'Active'. Matching is normalized (punctuation/spacing-insensitive) so 'digikey' resolves to 'Digi-Key'. Also fix scripts/dev.ts to spawn next with shell:true so it runs on Windows.
…view The vendor list lived only in a local .xlsx and was loaded by a CLI script, so deploys shipped an empty approved_vendors table. Any approved member can now upload finance's supplier export on the Finance page, review a git-diff-style preview (added / removed / changed vendors with old and new values), and apply it. - Move parse/diff/apply into src/lib/vendors/import.ts; scripts/import-vendors.ts is now a thin wrapper with --dry-run. - Locate columns by header text and reject files missing the supplier name/status columns; normalize line endings in multi-line cells. - Apply in one BEGIN IMMEDIATE transaction: update rows in place (stable ids), rebuild the FTS index, and log to a new vendor_import table. - Apply re-checks the file hash and the import the preview was based on, returning 409 if another import landed in between. - Switch xlsx to the SheetJS 0.20.3 build (fixes CVE-2023-30533, CVE-2024-22363 in the npm 0.18.5 release). - Document the upload workflow in the deploy guide.
matejstastny
force-pushed
the
feat/approved-vendor-search
branch
from
October 21, 2026 02:28
6684f67 to
abea61a
Compare
matejstastny
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
vendor_importtable.Also fix scripts/dev.ts to spawn next with shell:true so it runs on Windows.
Why
To see a list of approved vendors as you order. The vendor list only existed in a local spreadsheet loaded by a CLI script, so deploys shipped an empty table. Now any approved member can refresh it from the dashboard. No file copying on the server.
Type of change
feat/)fix/)chore/)docs/)refactor/)Checklist
pnpm lintpassespnpm format:checkpassesschema.tswas changed - migration generated (pnpm db:generate) and committed alongside the schema