Skip to content

Migrate room filtering to backend search API#191

Merged
Yalilix merged 11 commits intomainfrom
190-story4-15-migrate-room-filtering-from-client-side-logic-to-server-side-search-api
Apr 26, 2026
Merged

Migrate room filtering to backend search API#191
Yalilix merged 11 commits intomainfrom
190-story4-15-migrate-room-filtering-from-client-side-logic-to-server-side-search-api

Conversation

@Yalilix
Copy link
Copy Markdown
Collaborator

@Yalilix Yalilix commented Apr 25, 2026

What

Migrated room filtering from client-side logic to the existing backend room search API.

This PR adds a LiveFilterRoomLoader service that builds a filtered GET request to /api/rooms/search, decodes the returned room map, and extracts the matching room IDs for the app to use when displaying filtered room results.

Why

The app previously relied on filtering room data on-device, which duplicated logic that already exists in the backend and could become inefficient as the room dataset grows.

Using the backend search endpoint keeps the mobile app aligned with the established API behaviour and avoids maintaining complex filtering logic on the client.

How

  • Added a filter room loader service for fetching filtered room IDs from the backend.
  • Constructed the search URL using query parameters such as datetime, buildingId, capacity, duration, usage, location, startTime, and endTime.
  • Decoded the backend response as a room ID to room details map.
  • Extracted the dictionary keys as the filtered room IDs.
  • Added test doubles and unit tests for successful decoding, query parameter construction, nil filter handling, and failure behaviour.

Key checks:

  • 🚩Attached screenshot or recording of the changes in related tickets
  • Code comments where needed
  • No new warnings

Automated tests:

  • 🚩Unit tests added

Manual tests:

  • Big iPhone (iPhone 17 Pro Max)
  • Small iPhone (iPhone SE)

Screenshot / Recording

N/A

@Yalilix Yalilix requested a review from xleonx0x April 25, 2026 18:17
@Yalilix Yalilix self-assigned this Apr 25, 2026
@Yalilix Yalilix requested a review from floormatgen April 25, 2026 18:17
Copy link
Copy Markdown
Contributor

@xleonx0x xleonx0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just fix those small things e

@@ -0,0 +1,159 @@
//
// File.swift
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name doesn't match file

xleonx0x
xleonx0x previously approved these changes Apr 26, 2026
@Yalilix Yalilix merged commit caaff9b into main Apr 26, 2026
4 checks passed
@Yalilix Yalilix deleted the 190-story4-15-migrate-room-filtering-from-client-side-logic-to-server-side-search-api branch April 26, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

STORY#4-15: Migrate room filtering from client-side logic to server-side search API

2 participants