cornellh4i/okb-hope

Team 4 (Week 2 - Backend): Implement upload/download backend and filter approved/unapproved psych.

Opened this issue · 0 comments

Your tasks will be to implement the backend of your previous ticket in order to fully finish the admin side. (YAY WE ARE ALMOST DONE!)

You will be continuing to work on the same branch, ApprovePsych.

These tasks do not have to be worked in order. IN FACT, we recommend splitting up the tasks if possible.

Task 1: Implementing approved/unapproved psych

  • Add a new field for all psych accounts called status which will have two states approved and pending. frontend/src/components/psychQuestionnaire/PsychQuestionnaire.tsx currently is the location where information from the psych questionnaire is updated to the database.
  • Update the firebase such that every new psych account's status is pending
  • In the admin state, display a yellow icon for psych accounts with a pending status.
  • Upon admin approval, update the status of the respective psych account to approved, altering the flow accordingly. This follows the figma designs
    Image
  • If the admin rejects a psychiatric account, delete their information from the firebase.

Here is a helpful resource on how to tackle this deleting information:

Task 2: Implement backend for downloading button

In the previous ticket, you created the download button. Now we will retrieve the information.

  • Right now, when a psychiatrist signs up, there is a place for them to upload a profile image. We will modify this field to allow psych to upload files such as their resume, certificates, etc.
    Image
  • Moving back to the admin side, we will implement the download button. The flow is that when the admin presses the button, the admin should be able to retrieve everything that the psych uploaded from the previous field.

Here is a helpful resource:

Task 3: Filter bar on Admin Dashboard

This is the final feature of the admin side. Currently, main admin dashboard contains two tabs: Clients and Psychiatrists. However, selecting each tab does not alter the displayed cards.

Image

Image

  • Update the admin dashboard to ensure that selecting the Clients tab displays only patient profiles, while selecting the Psychiatrists tab shows only psychiatrist profiles.
  • For the Psychiatrists tab, incorporate an extra filter for status by approved or pending and ensure its functionality. This filter should automatically sort the psychiatrist's based on the account creation time of psychiatrists.
  • Right now, the filter bar on the admin dashboard has no functionality. Your job is to have this filter work! There is a similar filter that is used in the discover professionals page. I'd recommend looking at frontend/src/pages/patient/[patient_id]/discover.tsx to see how it currently filters data.