Back-end developer challenge 2021
An integration tool that loads data from a CSV file, schedules some email communications, and then executes automated tests to ensure all data and logic was executed correctly.
- Create a node.js project to loads the above data into a Patients collection in MongoDB. The collection will include all the data stored in the input data file.
- Create logic that schedules emails for every patient that has CONSENT=Yes.
- All emails should be stored in an Emails collection
- Each email should have an id, name, and scheduled_date
- Create multiple emails with the following information:
- Name: "Day 1", scheduled_date: NOW+1 day
- Name: "Day 2", scheduled_date: NOW+2 days
- Name: "Day 3", scheduled_date: NOW+3 days
- Name: "Day 4", scheduled_date: NOW+4 days
Parse csv data in stream using stream csv parser and load necessary data to mongo database. This solution provides us an ability to extract, transform and load large csv datasets with little memory footprint.
- Clone the code
git clone git@github.com:russellswift/challenge-2021.git
- Run the task using
docker-compose
docker-compose up
- Task will complete. To test it do not stop mongo container and follow the next steps
- Install dependencies
npm install
- Run tests
or
npm test
The last one will save report into file:npm run test-ci
output/report.xml
- Explore test results. You will find extended info about Patient IDs where the first name is missing and Patient IDs where the email address is missing there.