class LocationServiceHelper extends BaseHelper {

    public void fetchOpenMrsLocationsByTeamIds() throws NoHttpResponseException, JSONException {
        HTTPAgent httpAgent = getHttpAgent();
        if (httpAgent == null) {
            throw new IllegalArgumentException(OPENMRS_LOCATION_BY_TEAM_IDS + " http agent is null");
        }
        String baseUrl = getFormattedBaseUrl();

        Response resp = httpAgent.post(
                MessageFormat.format("{0}{1}", baseUrl, OPENMRS_LOCATION_BY_TEAM_IDS),
                new JSONArray().put(allSharedPreferences.fetchDefaultLocalityId(
                        allSharedPreferences.fetchRegisteredANM())).toString());

        if (resp.isFailure()) {
            throw new NoHttpResponseException(OPENMRS_LOCATION_BY_TEAM_IDS + " not returned data");
        }

        Timber.i(resp.payload().toString());
        JSONArray teamLocations = new JSONArray(resp.payload().toString());

        for (int index = 0; index < teamLocations.length(); index++) {
            JSONObject openMrsLocation = teamLocations.getJSONObject(index);
            if (openMrsLocation.has(LOCATIONS) && openMrsLocation.has(TEAM)) {
                JSONArray actualLocations = openMrsLocation.getJSONArray(LOCATIONS);
                saveOpenMrsTeamLocation(openMrsLocation, actualLocations);
            }
        }
    }

    public  LocationServiceHelper(LocationRepository locationRepository, LocationTagRepository locationTagRepository, StructureRepository structureRepository);

}