feat: add unit tests for featured listings, neighborhood scores + price history chart
- Add unit tests for FeatureListingHandler (6 tests) and ActivateFeaturedListingHandler (6 tests) - Add unit tests for NeighborhoodScoreServiceImpl (5 tests) and GetNeighborhoodScoreHandler (2 tests) - Add PriceHistoryChart component with recharts LineChart for listing detail page - Wire up price history API client and integrate chart into listing detail view Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -132,6 +132,14 @@ export interface SearchListingsParams {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface PriceHistoryItem {
|
||||
id: string;
|
||||
oldPrice: string;
|
||||
newPrice: string;
|
||||
source: string;
|
||||
changedAt: string;
|
||||
}
|
||||
|
||||
export interface NeighborhoodScoreResult {
|
||||
district: string;
|
||||
city: string;
|
||||
@@ -203,6 +211,9 @@ export const listingsApi = {
|
||||
return res.json() as Promise<{ mediaId: string; url: string }>;
|
||||
},
|
||||
|
||||
getPriceHistory: (listingId: string) =>
|
||||
apiClient.get<PriceHistoryItem[]>(`/listings/${listingId}/price-history`),
|
||||
|
||||
getNeighborhoodScore: (district: string, city: string = 'Hồ Chí Minh') =>
|
||||
apiClient.get<NeighborhoodScoreResult>(
|
||||
`/analytics/neighborhoods/${encodeURIComponent(district)}/score?city=${encodeURIComponent(city)}`,
|
||||
|
||||
Reference in New Issue
Block a user