-
Notifications
You must be signed in to change notification settings - Fork 0
Description
yayy first sprint of the semt!! 🤩
This week, you’ll be altering our main application flow to include an age preference question and fixing a minor bug in our hierarchical filtering (PR from last sem, ignore testing method) to familiarize yourself with our backend!
1. Fix the bug that prevents female inmates from being returned during the matching process.
- I suggest looking into union all statements and using them to alter our current logic that uses
order by. - Make sure to test this extensively! The “how to review” section here might be helpful, and you should get comfortable with using test rows in our
adopter_applications_dummytable.
2. Add a new question component called MainQuestionAge.tsx, which should ask the user about age preference.
- Since we don’t have any styling for it currently, you can have a very barebones layout for the time being (i.e., the question reads “What is your preference for the age of your adoptee? Please enter a valid range.” and just a text-input for now). Feel free to copy code from existing main app questions.
- Don’t forget to update the
FormStateinterface intypes.d.tsand other references to question data/inputs. Ensure that the new question navigation order is bio → gender → offense → age → reason → review responses.
3. Update our backend for the application to take in age preference.
- Create a new column in
adopter_applications_dummycalledage_prefwith the int2 array type (e.g. we would have [20, 40] to mean 20-40 years old). Make sure to regenerate the types indatabase.types.tsto match. If you haven’t done this before, make sure you define PROJECT_ID in your .env file, login with the Supabase CLI, then runpnpm gen-schema. - Ensure that
upsertApplicationinquery.tsis now upserting information about the age preference toadopter_applications_dummy. - Since we’re currently using a text-input, make sure that you are parsing and storing the age preference response as an int[], even within the application state.
Side note: be careful editing things in Supabase as we don’t have version control for any of the queries. One way you can do this is by creating a duplicated find_top_k_filtered function to edit and then updating our existing one once you know it works! You’ll have to regenerate types and update query.ts to be able to test + use your function.
I know some of this may be your first interactions with our backend, so please reach out if you need help getting started or have any questions!