feedingamerica / freshtrak-public

FreshTrak public access created with Can't Stop Columbus March 2020
4 stars 3 forks source link

Food Finder - Pantries - Additional Resources #38

Open karengreene opened 4 years ago

karengreene commented 4 years ago

As a customer, I want to find additional pantries that serve my zip code in case I cannot go to date/time specific events so that I can get the food and supplies I need. This application needs to be web and mobile friendly.


Problem

In locating pantries that serve zip codes, there are pantries that do NOT have any events scheduled within the searched time frames. The screen will then have an 'Additional Resources' section for pantries that do NOT have any events scheduled which will allow customers additional locations to find food.


Solution

Create a tool that can be used to: Find Food - a resource where families in need can enter a zip code (geocoded) and be directed to the nearest food resource available. This story is an 'Additional Resources' section on the main 'Food Finder' page and is specific to pantries that do NOT have events scheduled.


Screen Summary

The main screen lists food banks and pantries that serve that zip code. The scope of this story is for the 'Additional Resources' section of that result list. The main screen is divided into three sections (see wire frame):

  1. Food Banks - see issue #37
  2. Resource Events - see issue #1
  3. Additional Resources - pantries with no event dates scheduled within the determined time frame.

#####################################################

No pantries or Food Banks If there are no pantries or food banks that serve that zip code, display feeding america website.


Screen Inputs

Zip Code - valid five digit zip code


Screen Details

Additional Resources These are pantries that do not have events scheduled (events.status_published_event_date = 0). The screen should list the following information associated with each pantry :

Note that there are items on the wire frames that are out of scope for this story. See the Wireframes section for details.


Wire frames

Out of Scope

These wire frames show features that are NOT in scope for this story and will be done at some later time. I don't have edit privileges for these wire frames, so I also listed these below.

For the purpose of this story, ONLY focus on the 'Search for Resources' functionality. In this feature, the wire frames show the below items which will NOT be included in the MVP. These include:

###########################

Wire Frame Links

Wireframes in a mobile-experience view: https://www.figma.com/proto/R15ILgPqHRLhakIX9qIqQR/MOFC-MVP?node-id=237%3A828&scaling=scale-down

Wireframes in an Expanded Design View: https://www.figma.com/file/R15ILgPqHRLhakIX9qIqQR/MOFC-MVP?node-id=244%3A3009


Acceptance Criteria

AC - Test pantries sections Given that pantries exist for zip code served And pantries have events with a status_published_event_date of false When pantry list is displayed Then pantries are displayed in 'Additional Resources' section Sorted by shortest distance

AC - Test pantries results are ones that serve zip code Given that pantries exist for zip code served When pantry list is displayed Results include all pantries that serve that zip code

AC - Test pantries details - Additional Resources Given that pantries exist for zip code served And pantries have events with a status_published_event_date of false When pantry list is displayed Then pantry name, address, services, phone, distance, walkin/appointment, and general days and hours will be shown

############## Other Testing ################################

AC - If error retrieving data, user gets try again error Given that the user has launched “Find Food Tool” When there is an error in retrieving agency data Then "Error try again" will be displayed

AC - invalid zip code entered Given that the user has launched “Find Food Tool” When a invalid zip code is entered Then "please enter a valid zip code" will be displayed

AC - If there are no pantries or food banks, user gets feeding america website Given that a user has launched “Find Food Tool” When a user submits a valid zip code And there are no agencies or food banks that serve that zip code Then display a link to the Feeding America website (Feeding America’s “Find Your Local Food Bank ” tool Find Your Local Food Bank )

karengreene commented 4 years ago

David, Need feedback on query for this story. Please review and confirm. I

SELECT locations.loc_id, locations.loc_name, events.event_name, events.event_accept_walkin, service_types.service_desc, service_categories.service_category_name, locations.phone, events.address1, events.address2, events.city, events.state, events.zip, events.schedule_desc, foodbanks_mini.fb_url, foodbanks_mini.fb_agency_locator_url, foodbanks_mini.fb_fano_url
FROM locations INNER JOIN foodbanks_mini ON foodbanks_mini.status_id = 1 AND foodbanks_mini.fb_id = locations.primary_fb_id INNER JOIN foodbank_counties ON foodbank_counties.fb_id = foodbanks_mini.fb_id INNER JOIN CNTY ON CNTY.FIPS = foodbank_counties.fips INNER JOIN zip_codes ON zip_codes.priority = 1 AND zip_codes.fips = CNTY.FIPS INNER JOIN events ON events.status_id = 1 AND events.status_publish_event = 1 AND events.loc_id = locations.loc_id INNER JOIN events events_locations_join ON events_locations_join.status_id = 1 AND events_locations_join.status_publish_event = 1 AND events_locations_join.loc_id = locations.loc_id INNER JOIN service_types ON events.service_id = service_types.service_id INNER JOIN service_categories ON service_types.service_category1 = service_categories.service_category WHERE locations.status_id = 1 AND zip_codes.zip_code = '43046' AND events.status_id = 1 AND events.status_publish_event = 1 AND events.status_publish_event_dates = 0

davidpickering commented 4 years ago

I am not sure how useful it is for me to try and judge the SQL since it gets interpreted through Active Record. I see it includes foodbank information, but this story is about agencies - foodbanks are returned in a separate resource. Other than that, the big three status fields are properly represented:

AND events.status_id = 1 
AND events.status_publish_event = 1
AND events.status_publish_event_dates = 0

Anything else you would specifically like comments on?

karengreene commented 4 years ago

Don't worry about the active record. What I want to know is if this query returns the data you expect for additional resources.