Integrate catalogue service API and fix favorites sync
Summary
-
Catalogue service integration: Replaced mock data with real API calls to
darvest-catalogue-service. Addedsrc/types/catalogue.tswith typed DTOs (PropertyDetailResponse,PropertyStatus,PropertyMediaType, etc.) matching the service contract. UpdatedpropertyService.tsand all consumer pages/components (Properties,PropertyDetail,PortfolioPropertyDetail,InvestorDashboard,Portfolio,PropertyCard,InvestmentSimulator) to work with the new types. -
Bug fix — favorites not syncing on PropertyDetail:
PropertyDetail.tsxwas managing favorites with its own local state, reading/writing directly to the genericdarvest_favoriteslocalStorage key. This bypassedFavoritesContext, which uses the per-user keydarvest_favorites_<userId>. Clicking the heart on a property detail page had no effect on the rest of the app (portfolio, property cards, etc.). Fixed by replacing the local implementation withuseFavorites()(isFavorite+toggleFavorite) from the context.
Test plan
-
Browse /properties— list loads from catalogue service without errors -
Open a property detail page — all fields render correctly -
Click the heart icon on a property detail page — favorite state updates immediately -
Navigate to /propertiesor the portfolio — the same property shows as favorited -
Unfavorite from the detail page — syncs back across all pages -
Verify per-user isolation: favorite state resets when switching accounts