diff --git a/apps/api/src/modules/listings/domain/repositories/listing-read.dto.ts b/apps/api/src/modules/listings/domain/repositories/listing-read.dto.ts index 74178a4..b97d98f 100644 --- a/apps/api/src/modules/listings/domain/repositories/listing-read.dto.ts +++ b/apps/api/src/modules/listings/domain/repositories/listing-read.dto.ts @@ -28,13 +28,18 @@ export interface ListingDetailData { latitude: number; longitude: number; areaM2: number; + usableAreaM2: number | null; bedrooms: number | null; bathrooms: number | null; floors: number | null; + floor: number | null; + totalFloors: number | null; direction: Direction | null; yearBuilt: number | null; legalStatus: string | null; amenities: unknown; + nearbyPOIs: unknown; + metroDistanceM: number | null; projectName: string | null; media: ListingMediaData[]; }; diff --git a/apps/api/src/modules/listings/infrastructure/repositories/listing-read.queries.ts b/apps/api/src/modules/listings/infrastructure/repositories/listing-read.queries.ts index 53f3880..af1e516 100644 --- a/apps/api/src/modules/listings/infrastructure/repositories/listing-read.queries.ts +++ b/apps/api/src/modules/listings/infrastructure/repositories/listing-read.queries.ts @@ -62,13 +62,18 @@ export async function findByIdWithProperty( latitude: geo.latitude, longitude: geo.longitude, areaM2: listing.property.areaM2, + usableAreaM2: listing.property.usableAreaM2, bedrooms: listing.property.bedrooms, bathrooms: listing.property.bathrooms, floors: listing.property.floors, + floor: listing.property.floor, + totalFloors: listing.property.totalFloors, direction: listing.property.direction, yearBuilt: listing.property.yearBuilt, legalStatus: listing.property.legalStatus, amenities: listing.property.amenities, + nearbyPOIs: listing.property.nearbyPOIs, + metroDistanceM: listing.property.metroDistanceM, projectName: listing.property.projectName, media: listing.property.media.map((m) => ({ id: m.id, diff --git a/apps/web/components/listings/__tests__/listing-detail-client.spec.tsx b/apps/web/components/listings/__tests__/listing-detail-client.spec.tsx index 9d0ed71..83defde 100644 --- a/apps/web/components/listings/__tests__/listing-detail-client.spec.tsx +++ b/apps/web/components/listings/__tests__/listing-detail-client.spec.tsx @@ -82,13 +82,18 @@ function makeListing(overrides: Partial = {}): ListingDetail { district: 'Quận Bình Thạnh', city: 'Hồ Chí Minh', areaM2: 75, + usableAreaM2: 68, bedrooms: 2, bathrooms: 2, floors: null, + floor: null, + totalFloors: null, direction: 'SOUTH', yearBuilt: 2020, legalStatus: 'Sổ hồng', amenities: ['Hồ bơi', 'Gym'], + nearbyPOIs: null, + metroDistanceM: null, projectName: 'Vinhomes Central Park', latitude: 10.7975, longitude: 106.721, diff --git a/apps/web/components/listings/listing-detail-client.tsx b/apps/web/components/listings/listing-detail-client.tsx index ad8b0e2..d54c337 100644 --- a/apps/web/components/listings/listing-detail-client.tsx +++ b/apps/web/components/listings/listing-detail-client.tsx @@ -138,12 +138,29 @@ export function ListingDetailClient({ listing }: ListingDetailClientProps) { {property.bathrooms != null && ( )} - {property.floors != null && ( + {property.floor != null && property.totalFloors != null && ( + + )} + {property.floor != null && property.totalFloors == null && ( + + )} + {property.floor == null && property.floors != null && ( )} {property.direction && ( )} + {property.metroDistanceM != null && ( + + )}
@@ -167,14 +184,39 @@ export function ListingDetailClient({ listing }: ListingDetailClientProps) {
- + + - + +
@@ -387,6 +429,11 @@ function QuickStat({ icon, label, value }: { icon: string; label: string; value: ), + transit: ( + + + + ), }; return ( diff --git a/apps/web/lib/listings-api.ts b/apps/web/lib/listings-api.ts index 7d5110e..dc8bc7f 100644 --- a/apps/web/lib/listings-api.ts +++ b/apps/web/lib/listings-api.ts @@ -56,13 +56,18 @@ export interface ListingDetail { district: string; city: string; areaM2: number; + usableAreaM2: number | null; bedrooms: number | null; bathrooms: number | null; floors: number | null; + floor: number | null; + totalFloors: number | null; direction: Direction | null; yearBuilt: number | null; legalStatus: string | null; amenities: string[] | null; + nearbyPOIs: unknown; + metroDistanceM: number | null; projectName: string | null; latitude: number | null; longitude: number | null;