Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contribute Detroit filters to Bloom #1884

Merged

Conversation

abbiefarr
Copy link
Contributor

Issue

Addresses CityOfDetroit#566

  • This change addresses the issue in full
  • This change addresses only certain aspects of the issue
  • This change is a dependency for another issue
  • This change has a dependency from another issue

Description

Apologies for the large PR. For most of us this is the last week on the project, so I'm trying to make this contribution before I leave the team.

This PR contributes a number of Detroit's filters upstream, with the intention to add functionality and keep our code bases as synced as possible.

Some new filters follow the standard filters code path with regular comparisons (e.g. minRent). Others require special clauses, which have been pulled out into a separate file called custom_filters.ts.

Contributed filters include:

  • seniorHousing: this is pulled from the reservedCommunityType column. It checks for a match with "senior62" in the database. This is added as a custom filter.
  • minRent and maxRent: these are pulled from unitsSummary.monthly_rent_[min|max], and implemented as normal >= or <= filters.
  • ami: pulls from unitsSummary.ami_percentage if that is populated, otherwise queries listings.ami_percentage_max. Checks for values >= the provided AMI.
  • availability: There are 3 possible values for availability: hasAvailability, noAvailability, and waitlist. Results are queried from unitsSummary.total_available if the filter is for has or no availability. Pulls from listings.is_waitlist_open if the filter is for a waitlist.

The addition of $include_nulls to BaseFilter is also included. If set to true, null values will be considered a match on the filter and will be returned in the results. This is useful if data is incomplete.

We also trivially added a <= comparison filter.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Prototype/POC (not to merge)
  • This change is a refactor/address technical debt
  • This change requires a documentation update
  • This change requires a SQL Script

How Can This Be Tested/Reviewed?

Unit tests were added for the $include_nulls functionality.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have reviewed the changes in a desktop view
  • I have reviewed the changes in a mobile view
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have assigned reviewers
  • I have updated the changelog to include a description of my changes
  • I have run yarn generate:client if I made backend changes

@netlify
Copy link

netlify bot commented Sep 27, 2021

✔️ Deploy Preview for dev-partners-bloom ready!

🔨 Explore the source changes: da01c87

🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-partners-bloom/deploys/615b975a62815600089ef16c

😎 Browse the preview: https://deploy-preview-1884--dev-partners-bloom.netlify.app

@netlify
Copy link

netlify bot commented Sep 27, 2021

✔️ Deploy Preview for dev-bloom ready!

🔨 Explore the source changes: da01c87

🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-bloom/deploys/615b975ac245810008b6ca5f

😎 Browse the preview: https://deploy-preview-1884--dev-bloom.netlify.app

@netlify
Copy link

netlify bot commented Sep 27, 2021

✔️ Deploy Preview for dev-storybook-bloom ready!

🔨 Explore the source changes: da01c87

🔍 Inspect the deploy log: https://app.netlify.com/sites/dev-storybook-bloom/deploys/615b975a17f78700073c4702

😎 Browse the preview: https://deploy-preview-1884--dev-storybook-bloom.netlify.app

@abbiefarr abbiefarr force-pushed the sync-backend-filters-with-detroit branch from 9b6a92a to 25a7df4 Compare September 27, 2021 17:48
@abbiefarr
Copy link
Contributor Author

@seanmalbert failures don't seem related, but I can't find how to retrigger a build. So I'll say this is ready for review, and if you have any insight into the test failures that would be very appreciated!

@emilyjablonski
Copy link
Collaborator

@seanmalbert Test failures look unrelated to this PR to me :)

Copy link
Collaborator

@seanmalbert seanmalbert left a comment

Choose a reason for hiding this comment

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

Thank you for contributing these filters, @abbiefarr!

@seanmalbert seanmalbert merged commit 9f1142e into bloom-housing:dev Oct 5, 2021
@seanmalbert seanmalbert deleted the sync-backend-filters-with-detroit branch October 5, 2021 02:18
seanmalbert added a commit to CityOfDetroit/bloom that referenced this pull request Jun 23, 2022
* Contribute Detroit filters to Bloom

* Contribute Detroit filters to Bloom

* update changelog

* fix malformed query

* rename ami filter

* Don't include nulls in senior housing filter

* fix: cleanup after upstream merge

Co-authored-by: Sean Albert <smabert@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants