Skip to content
This repository has been archived by the owner on Jul 24, 2022. It is now read-only.

Nearest local group #25

Open
pedro-gutierrez opened this issue Sep 19, 2020 · 2 comments
Open

Nearest local group #25

pedro-gutierrez opened this issue Sep 19, 2020 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@pedro-gutierrez
Copy link
Contributor

pedro-gutierrez commented Sep 19, 2020

Is your feature request related to a problem? Please describe.

If a user doesn't know the exact name of a group, it is not easy to find it.

As a user/prospective volunteer,
I want to be able to find the closest group to my location
So that I can contact them and begin volunteering

Describe the solution you'd like

  • A GraphQL query that returns a list of Groups, given a starting set of coordinates.
  • We will need to extend the existing Address type, eg:
type Address {
...
  location: Coordinates!
...
}
  • The addresses database table will also need a migration, so that we can store coordinates (latitude and longitude) for each address. Existing queries and mutations and tests might also need to be reviewed, unless we decide to make this optional.

GraphQL contract:

type Coordinates {
  latitude: Float!
  longitude: Float!
}

type Query {
  findGroupsNearby(to: Coordinates!, limit: Int!): [Group!]!
}
  • The GraphQL resolver should be thin and delegate to a Ferry.Locations.findGroupsNearby context function.
  • Given that the database model allows for a single group to have multiple addresses, we need to account for potential duplicates in the returned list.
  • We will need to rely on Postgres' geospatial extensions in order to implement this feature.
@pedro-gutierrez pedro-gutierrez added enhancement New feature or request help wanted Extra attention is needed labels Sep 19, 2020
@pedro-gutierrez pedro-gutierrez changed the title User can search for their nearest local group Nearest local group Sep 19, 2020
@asolove
Copy link

asolove commented Oct 27, 2020

👋 I'm pondering trying this out, but no promises. One question:

Users must enter their country and postal code to search

Any objection to offering browser Geolocation as an option in addition?

@pedro-gutierrez
Copy link
Contributor Author

Hello! thank you for getting in touch! It would be awesome to have this feature indeed. This ticket is a bit old, so I just reworked the description, please let me know if the new spec is more in line with what you were suggesting? Happy to assist if you need any help or further clarification.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants