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

Resident Directory Filter #205

Merged
merged 4 commits into from
Jan 1, 2024
Merged

Conversation

phamkelly17
Copy link
Contributor

Notion task link

Resident Directory Filter

Implementation description

  • Implement backend for filtering residents
  • can filter by resident_id, building_id, date_range
  • see Notion documentation for get_residents()

Steps to test

  1. Test endpoints on Postman
  2. Test individually all filters
  3. Test together

What should reviewers focus on?

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR
  • If I have made API changes, I have updated the REST API Docs
  • IF I have made changes to the db/models, I have updated the Data Models Page
  • I have documented this PR in the Production Release Page
  • I have updated other Docs as needed

Copy link

github-actions bot commented Nov 19, 2023

Visit the preview URL for this PR (updated for commit 7bb09ea):

https://blueprintsupportivehousing--pr205-kelly-resident-direc-x79cmvva.web.app

(expires Sat, 06 Jan 2024 03:43:37 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f6bcdba7452bf82a6ec1a299c37d1bdff7870d09

@braydonwang
Copy link
Contributor

Just wondering, is this the right endpoint url to call when we want to filter by date range but only provide a start date?

localhost:8080/residents?filters={"date_range":{"date_joined": "2023-11-23", "date_left": None}}

@phamkelly17
Copy link
Contributor Author

@braydonwang this is the correct endpoint:

http://localhost:8080/residents?filters={"date_range": ["2024-1-31", null]}

Copy link
Contributor

@owen-sellner owen-sellner left a comment

Choose a reason for hiding this comment

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

LGTM!!! I added the one nit that we already talked about.

hour=0, minute=0
)

residents_results = Residents.query.join(
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably can be moved out of the if-else statements since it is always used.

@connor-bechthold connor-bechthold merged commit e942177 into main Jan 1, 2024
3 checks passed
@connor-bechthold connor-bechthold deleted the kelly/resident-directory-filters branch January 1, 2024 21:01
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.

4 participants