Skip to content

fix(dashboard): source discover vehicles from live inventory API - #225

Open
harystyleseze wants to merge 1 commit into
Chainmove:mainfrom
harystyleseze:fix/discover-vehicles-live-inventory-196
Open

fix(dashboard): source discover vehicles from live inventory API#225
harystyleseze wants to merge 1 commit into
Chainmove:mainfrom
harystyleseze:fix/discover-vehicles-live-inventory-196

Conversation

@harystyleseze

Copy link
Copy Markdown
Contributor

Summary

The vehicle discovery card grid rendered a fixed, hard-coded list of eight fictional vehicles (with invented drivers, returns, and funding progress) instead of the platform's real vehicle inventory, so it could present fabricated investment opportunities as if they were live listings.

Changes

  • components/dashboard/discover-vehicles.tsx: removed the hard-coded mockVehicles fixture and now fetches vehicles from the existing GET /api/vehicles inventory endpoint on mount and on manual refresh.
  • Added explicit loading (skeleton), error (with retry), and empty-inventory states.
  • Added a freshness check: inventory older than 5 minutes is flagged stale and funding actions are disabled until the data is refreshed.
  • Retired (delisted) vehicles are excluded from the opportunities list; the "Fund Vehicle" action is only enabled when a vehicle's fundingStatus is Open, its status is Available, and the data is not stale.
  • Card fields now map only to server-owned data returned by the API (price, ROI, status, funding progress derived from totalFundedAmount/price, complianceStatus, driver-assignment presence, and vehicle specifications) instead of fabricated driver names, ratings, and locations.
  • components/dashboard/__tests__/discover-vehicles.test.tsx (new): covers empty inventory, API failure, network failure, delisted-vehicle exclusion, fully-funded vehicles being non-actionable, and partial/missing optional fields.

Issues

Resolves #196

Verification

  • Manual code review of the full diff was completed.
  • cargo build was not run.
  • cargo test was not run.
  • No snapshots were added or modified.

Replace the hard-coded vehicle fixture in DiscoverVehicles with a fetch
against /api/vehicles, adding loading, error/retry, and empty states.
Delisted, fully-funded, and stale opportunities are no longer actionable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PRODUCT INTEGRITY][VEHICLE DISCOVERY] Source investment vehicles from the live inventory API

1 participant