Add vendor enrichment and transaction selection#22
Merged
Conversation
e3f4451 to
7cd40ce
Compare
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.
Original request
Add vendor information so users can optionally attach a vendor to an expense, select a vendor first and get a category suggestion from prior usage, enrich vendors with third-party metadata, document the required env/secrets, and use the user's country for better vendor matching.
Follow-up work also moved vendor management out of the main daily nav, replaced the old brand/merchant dashboard block with a dedicated Vendors analytics page, preserved Dashboard/Vendors period state, globally renamed Brands/Merchants to Vendors, added vendor context to weekly/monthly LLM report summaries, improved the Vendor edit/Capture picker UX, and made vendor analytics totals match Dashboard by including transactions without a vendor.
What changed
/vendors./settings/vendorsand vendor details/history to/settings/vendors/[vendorId].periodanddatewhen switching between Dashboard and Vendors.No vendorrows for each transaction type when present, so totals reconcile with Dashboard.No vendorgroups usingvendorId=none, backed by contract/API query parsing with@cleverbrush/schemaunion types.purchasewording withtransactionon Vendors surfaces.Enrichedbadge/status column from the Manage Vendors table./vendors, matching Dashboard.Refresh detailsaction instead of raw enrichment/provider diagnostics.VENDOR_ENRICHMENT_*and kept Brandfetch provider terms only where they refer to Brandfetch itself.Reasoning
Vendor analytics now behaves like the existing Dashboard analytics instead of adding another always-visible panel to Dashboard. Vendor management is in Settings because users rarely edit vendors after creation, while the main Vendors nav item is reserved for period-based spending analysis.
The Vendor edit flow keeps user-entered Display name as the canonical app label and treats Brandfetch data as optional suggestions. This avoids confusing users with duplicate technical name fields while still allowing them to improve logo/domain/description/color metadata.
vendorId=noneis modeled directly in the transaction query contract with a schema union instead of a parallel boolean flag, so the UI URL and API filter describe the same concept clearly.Environment And Third-Party Setup
GitHub repository secret:
GitHub repository variable and local/production Compose variable:
Optional GitHub repository variables and local/production Compose variables:
Third-party account/key to create for this feature:
OpenAI is intentionally not listed as a new account/key.
PR Environment Notes
/opt/pr-env/pr-env.shonroot@10.200.1.2and verified it reads/exportsVENDOR_ENRICHMENT_ENABLEDandVENDOR_ENRICHMENT_TIMEOUT_MS.pr22compose project, removingpr22_postgres_data, and removing/var/lib/pr-envs/pr-22/db.initialized.pr22_postgres_dataand/var/lib/pr-envs/pr-22/db.initialized, confirming the production logical restore path ran.Screenshots / Preview Evidence
Preview URL:
https://xpenser-pr-022.cleverbrush.com/dashboardshows the requested nav order: Dashboard, Vendors, Add, Transactions, Reports.periodanddatequery parameters./vendors?period=year&date=2026-06-04renders vendor analytics with Income and Expenses sections. The preview data showsNo vendorincome and expense groups plus Walmart, and the group totals match the visible Dashboard totals for the same period./vendorsincludes the Dashboard-styleAdd transactionbutton./settings/preferencesincludes a Vendors section withManage vendors./settings/vendorslists Walmart with suggested category and transaction count; the previous Status/Enriched column is no longer present./settings/vendors/1renders a friendly Vendor profile with Edit, Refresh details, website, and transaction history, without duplicate name fields or raw enrichment diagnostics.Walmartshowed multiple Brandfetch candidates, including regional variants, and selecting one displayed a review panel with per-field Use/Keep controls before save./captureshows no vendor suggestion list on initial load. Focusing the Vendor textbox and typingWalopens an autocomplete with saved Walmart first and Brandfetch logo/domain candidates after it. Typing the exact saved nameWalmartleaves only the local Walmart suggestion after debounce./tmp/pr22-vendors-groups.png,/tmp/pr22-settings-vendors-no-status.png, and/tmp/pr22-capture-autocomplete.png.SigNoz Findings
Last hour after preview QA, scoped to
xpenser-web-pr-22andxpenser-api-pr-22:Validation
Local:
npm run buildpassed when rerun with sandbox escalation because Turbopack needs to bind a local worker port in this environment.GitHub checks for
2722865:Preview QA: