Skip to content

Feat/websocket - #999

Merged
nanaf6203-bit merged 6 commits into
MettaChain:mainfrom
codesailor4:feat/websocket
Jul 27, 2026
Merged

Feat/websocket#999
nanaf6203-bit merged 6 commits into
MettaChain:mainfrom
codesailor4:feat/websocket

Conversation

@codesailor4

Copy link
Copy Markdown
Contributor

Changes Made to Fix Property Search:

1. Replaced Mock Data with Real Database Queries

  • Removed the hardcoded items: any[] = [] and total = 0 that returned empty results
  • Implemented real database queries using Prisma to fetch actual property data from the database

2. Implemented Pagination

  • Added proper pagination calculation: const skip = (page - 1) * limit
  • Passed skip and take parameters to Prisma's findMany method
  • Maintained the default page size of 20 items per page

closes #898

3. Implemented Sorting

  • Added dynamic sorting using orderBy: { [field]: order }
  • Maintained the default sort by createdAt in descending order
  • Supports any valid field for sorting with either ascending or descending order

4. Full-Text Search Implementation

  • The existing text search across title, description, address, city, and state is now functional
  • Uses Prisma's contains with mode: 'insensitive' for case-insensitive partial matching
  • OR condition properly searches across all specified fields

closes #899

5. Geographic Filtering Works

  • The existing geographic filtering from SearchGeographicService is now integrated
  • Supports both radius and polygon filtering
  • Uses the Haversine formula to accurately calculate distances between coordinates

6. Facets with Correct Counts

  • Updated to generate facets from all matching properties, not just the paginated subset
  • This ensures facet counts reflect the total number of matching properties, not just the current page
  • SearchFacetsService.buildFacets() correctly counts occurrences of each facet value

closes #909

7. All Other Filtering Works

  • Price range, bedrooms, bathrooms, square footage, property type, status, and all other filters from SearchFiltersService are now functional
  • They properly build the Prisma where clause to filter the database query

All Acceptance Criteria Met:

Property search returns real results from database - Now queries PostgreSQL instead of returning mock data
Full-text search across title, description, address, city, state - Implemented and working
Geographic radius/polygon filtering works - Geographic service is properly integrated
Facets returned with correct counts - Facets built from all matching properties, not just paginated
Pagination and sorting work - Proper pagination and dynamic sorting implemented

closes #910

The property search functionality is now fully functional and returns real, filtered, sorted, and paginated results from the database with accurate facet counts.

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@codesailor4 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@nanaf6203-bit
nanaf6203-bit merged commit 47186c7 into MettaChain:main Jul 27, 2026
5 of 6 checks passed
nanaf6203-bit added a commit that referenced this pull request Jul 27, 2026
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