We need your help to beat the COVID pandemic !!
this challenge will test your Back-End skills. you are required to use express.js and sequelize to analyze data from the given data base.
- Create the right migrations and models based on the requirements we give (you can run the seed files with npx sequelize db:seed:all to see that the tables are right)
- Create an express server that will analyze details from the data base and display it to the client.
- Build Rest-API for each model in the data base.
- Pass all the tests.
- Use the Sequelize Paranoid (in all tables), make sure that all models have "deletedAt" column.
- Use underscore in DB in all the models tables. In node it should perform in camelCase. Hint: ("define": {"underscored": true})
- After you created all your models and tables you can run the seeders command, that will run the seeders file that you have in your backend (command: npx sequlize-cli db:seed:all)
- SQL only!
- Use Sequelize
- Database name has to be called - "covid_19"
- Columns: id, dateOfBirth, name, symptom, status('sick', 'respiratory', 'recovered', 'dead', 'isolation'), cityId, hospitalId.
- Columns: id, name, population.
- Columns: id, name, respiratorAmount, maxCapacity.
- Columns: id, name
- Columns: id, patientId, symptonId
- Columns: id, patientId, isSick(boolean).
- GET "/api/v1/patients" all patients with their city, symptoms, covid test and status.
- GET "/api/v1/patients/byId/:patientId" patient by id with their city, symptoms, covid test and status.
- GET "/api/v1//byName/:patientName" patient by name with their city, symptoms, covid test and status.
- GET "/api/v1/patients/positive" all patients with covid Tests that are positive.
- POST "/api/v1/patients" a new patient with new CovidTests and thier new symptom
- "/api/v1/patients/:patientId DELETE a patient.
- GET "/api/v1/hospitals" all hospitals with their capacity (maxCapacity), number of respirator (respiratorAmount)
- GET "/api/v1/hospitals/byId/:hospitalId" Hospital by id.
- GET "/api/v1/hospitals/respirator_luck" all the hospitals that need to bring more respirator machines (less than five machines that are available in the hospital).
- GET "/api/v1/cities" all cities number of sick people in every hospital in the city.
- GET "/api/v1/cities/byId/:cityId" city by id with its number of patients.
- GET "/api/v1/cities/mostsick" the city with the most patients (regardless of their state) as an array as there can be several cities at the top.
- PUT "/api/v1/cities/:cityId" update a city name or population.
- DELETE "/api/v1/cities/:cityId" a city.
- GET "/api/v1/symptoms" all symptoms.
- GET "/api/v1/symptoms/byId/:symptomId" symptom by id.
- POST "/api/v1/symptoms" add new symptom for patient
- DELETE "/api/v1/symptomsByPatient/:patientId" delete symptom by patient id.
- GET "/api/v1/covidtests/test-results/:testResult" The amount of covid test by result(true- 1/ false- 0)
- GET "/api/v1/covidtests/test-results/:pateintId" All covid tests by patient id.
- PUT "/api/v1/covidtests/:testId update covid test result by the test id.
- DELETE a patient with paranoid.
- DELETE "/api/vi/covidtests/:testId a covid test.