SEG2105-Group / JobZi

SEG2105 Android Application: Allows home owners and service providers to be matched to allow home owners to use the services of the service providers.
1 stars 0 forks source link

Add search by service type functionality in search utility class. #148

Closed ghost closed 5 years ago

ghost commented 6 years ago

The following functionality is to be added in the SearchUtil class.

The method in which this is implemented should receive a Service objects which has been selected using the ServiceSelectorActivity.

First, retrieve all users and loop through them (only considering users of type service provider). Next, get the service provider profile. Using the profile, loop through all the services provided by this service provider. If a service matches (using the equals method in Service; implement it to check if the name and hourly rate are equal, not the id) then break add this service provider user object to an array list of matched service providers. This signifies that this service provider provides the requested service. Now move on to the next one in the loop. The array list should be passed into the method so that it can populate it (retrieving data from firebase is asynchronous therefore making it impossible to return anything from this method).

ghost commented 5 years ago

Done in pull request #167.