feat(listings): add ROOM_RENTAL, CONDOTEL, SERVICED_APARTMENT property types (GOO-20)
- Add ROOM_RENTAL, CONDOTEL, SERVICED_APARTMENT to PropertyType enum in schema.prisma - Create migration 20260422010000_add_room_rental_property_types with ALTER TYPE ADD VALUE - Add DEFAULT_RANGES in PrismaPriceValidator: ROOM_RENTAL 1M-10M VND/month, CONDOTEL 20M-300M, SERVICED_APARTMENT 20M-250M VND/m² - Add i18n translations: vi "Phòng trọ / Condotel / Căn hộ dịch vụ", en "Room Rental / Condotel / Serviced Apartment" - Typesense indexes propertyType as a generic string facet — no schema change needed Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -65,6 +65,17 @@ describe('PropertySearchServer', () => {
|
||||
});
|
||||
|
||||
describe('search_properties', () => {
|
||||
it('always filters by uppercase ACTIVE status matching Prisma enum', async () => {
|
||||
client._search.mockResolvedValue(makeHits([]));
|
||||
const handler = getToolHandler(server, 'search_properties');
|
||||
|
||||
await handler({ query: '*', page: 1, perPage: 20 });
|
||||
|
||||
const filterBy = client._search.mock.calls[0][0].filter_by as string;
|
||||
expect(filterBy).toContain('status:=ACTIVE');
|
||||
expect(filterBy).not.toContain('status:=active');
|
||||
});
|
||||
|
||||
it('searches with basic query', async () => {
|
||||
const handler = getToolHandler(server, 'search_properties');
|
||||
const result = await handler({ query: 'căn hộ Quận 7', page: 1, perPage: 20 });
|
||||
@@ -101,7 +112,7 @@ describe('PropertySearchServer', () => {
|
||||
});
|
||||
|
||||
const filterBy = client._search.mock.calls[0][0].filter_by as string;
|
||||
expect(filterBy).toContain('status:=active');
|
||||
expect(filterBy).toContain('status:=ACTIVE');
|
||||
expect(filterBy).toContain('propertyType:=apartment');
|
||||
expect(filterBy).toContain('transactionType:=sale');
|
||||
expect(filterBy).toContain('priceVND:>=1000000000');
|
||||
|
||||
Reference in New Issue
Block a user