Skip to content

Add UPC support to product import, item search and UI#1

Open
mch987 wants to merge 1 commit into
mainfrom
codex/add-upc-functionality-to-product-database
Open

Add UPC support to product import, item search and UI#1
mch987 wants to merge 1 commit into
mainfrom
codex/add-upc-functionality-to-product-database

Conversation

@mch987
Copy link
Copy Markdown
Owner

@mch987 mch987 commented Apr 27, 2026

Motivation

  • Allow UPC/barcode to be stored and used when importing products so scanned barcodes can prefill items and detect duplicates.
  • Make UPC searchable so users can find items by barcode from the main item search flow.
  • Surface UPC in the UI (create modal, edit form and import modal) to improve scanning/import UX.

Description

  • Added upc to the entity API types and DTOs used by the frontend (EntityCreate, EntityUpdate, EntityOut, EntitySummary) so UPC is part of the API contract and form payloads.
  • Wired product import flow so the barcode returned from product lookup is placed into the item create payload and persisted (backend maps UPC into the existing import_ref storage field to avoid ent codegen changes in this rollout).
  • Extended repository search to include UPC (implemented via ImportRefContainsFold where UPC is stored) so searching by barcode will find matching items.
  • Added duplicate-detection UI in the Barcode/Product Import modal that queries existing items for the scanned UPC and shows quick “Open” buttons for matches before importing a new item.
  • Exposed UPC in the item create modal and item edit form and added an English locale key for the items.upc label.

Testing

  • Attempted to run backend repository tests with go test ./internal/data/repo -run TestNormalizeSearchQueryIntegration, but execution did not complete in this environment (test run/timeouts and go generate failed due to external network/module fetch restrictions), so the full automated test suite was not completed.
  • Verified repository changes were committed successfully (git commit completed) and performed local inspections of modified TypeScript and Vue files to ensure the new upc fields are passed through create/update flows and rendered in the UI.
  • Manual smoke checks in code: ensured product import modal now queries api.items.getAll and filters by upc to display existing items (no runtime test harness was executed here).

Codex Task

@mch987 mch987 added enhancement New feature or request and removed codex labels Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant