Skip to content

Add eBay comparable-based physical asset valuations - #277

Merged
Monster0506 merged 4 commits into
mainfrom
feat/65-ebay-comparable-valuations
Sep 20, 2026
Merged

Monster0506 merged 4 commits into
mainfrom
feat/65-ebay-comparable-valuations

Conversation

@Sumedh-Joshi

@Sumedh-Joshi Sumedh-Joshi commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Implements external comparable retrieval and explicit no-comps behavior for physical asset valuations, via eBay's Browse API.

  • Query eBay Browse API for used/refurbished USD listings using the confirmed label, brand, and model (client-credentials OAuth2, token cached in memory for its ~2hr lifetime).
  • Return usable USD prices, source, listing title, and condition as structured evidence; calculate the estimate from the median.
  • Return a null value and low-confidence explanation when no usable comps are found.
  • New: falls back to the existing LLM price guess (AiEstimatedValuationService) when eBay itself fails — missing credentials, network error, rate limit — instead of surfacing "Failed to retrieve comparable market listings." to the user. A genuine zero-results response (the call succeeded, no comps exist) is left as-is; that's not a failure.
  • Add credential configuration (Ebay:ClientId/Ebay:ClientSecret) and tests for OAuth flow, token reuse, request construction, response mapping (including condition/currency filtering), empty results, error handling without leaking the client secret, disk-cache reuse, and valuation/fallback behavior.

Live-verified against eBay's real sandbox (not just mocks): confirmed the OAuth flow, that eBay's own conditions:{...} filter does not reliably exclude "New" listings (hence the client-side conditionId re-check), and that sandbox inventory is sparse for real product names — which is exactly why the fallback matters. Rebuilt the container with real sandbox credentials and clicked Revalue on a live item: real token fetch, real Browse API search, result cached to App_Data/ebay-search-cache/*.json.

Note: this branch previously regressed to a SerpApi Google-Search scrape (see commit history) after the original eBay integration shipped. That code is fully removed here; eBay is the only market-data provider again.

Closes #65
Closes #66
Closes #67

@Sumedh-Joshi
Sumedh-Joshi force-pushed the feat/65-ebay-comparable-valuations branch from 2b99e56 to a30ce87 Compare September 20, 2026 11:11
@Monster0506
Monster0506 marked this pull request as draft September 20, 2026 11:48
@Sumedh-Joshi
Sumedh-Joshi force-pushed the feat/65-ebay-comparable-valuations branch from a30ce87 to 4691ba6 Compare September 20, 2026 11:54
@Sumedh-Joshi
Sumedh-Joshi changed the base branch from fix/occupation-salary-scale-validation to main September 20, 2026 11:55
@Sumedh-Joshi
Sumedh-Joshi force-pushed the feat/65-ebay-comparable-valuations branch from 4691ba6 to a11593a Compare September 20, 2026 12:16
@Monster0506
Monster0506 marked this pull request as ready for review September 20, 2026 12:21
@Sumedh-Joshi
Sumedh-Joshi force-pushed the feat/65-ebay-comparable-valuations branch from a11593a to 43a58fb Compare September 20, 2026 12:29
@Monster0506
Monster0506 force-pushed the feat/65-ebay-comparable-valuations branch from 43a58fb to 670ab29 Compare September 20, 2026 13:13
@Monster0506
Monster0506 merged commit 041d529 into main Sep 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants