heart icon indicating copy to clipboard operation
heart copied to clipboard

Rewrite this issue: Add backend and endpoints related to the status/timeline component

Open tienyuan opened this issue 5 years ago • 1 comments

We'll need new endpoints to update the status for use with the status/timeline component (#84)

Currently we've got a status field in the participants table, it's an enumerable. We need to add another field to this table to store which databases has been checked for this individual.

According to http://www.postgresqltutorial.com/postgresql-json/ we can use the json datatype to store json. And the json we store can be something like ...

{
  "CCHRS" : true,
  "W&W" : false,
  "DMV" : false,
  "TCIS" : false
}

We want to be able to change each database value to true/false independently.

Notes:

  1. please update init.sql for any changes/new field needed
  2. please add backend endpoints to the participant route for use with the status
  3. please add backend endpoints to the participants route for use with the database-checked

tienyuan avatar May 07 '19 02:05 tienyuan

For init.sql database, I was thinking to create a new table for status and background check and define in the following way. Please let me know if you have any suggestions.

 CREATE TABLE status(
   id SERIAL PRIMARY KEY,
   status ENUM(
     'New Case',
     'Obligation Form Completed',
     'Waiting for Background Check',
     'Attorney Review',
     'Sent to Court',
     'Received From Court',
     'Sent to Participant',
     'Close')
 )

 CREATE TABLE background_check(
   id SERIAL PRIMARY KEY,
   cchrs BOOLEAN,
   w&w BOOLEAN,
   dmv BOOLEAN,
   tcis BOOLEAN,
   FOREIGN KEY (participant_id) REFERENCES participants (id)
 )

ArataKagan avatar May 14 '19 00:05 ArataKagan