Code kata in Node.js where you have to write a report of orders.
We want to write a node app to extract data from csv files which contain order and product data .
Develop your code based on Node.js.
Keep the following priorities in mind while you implementing:
- Code quality
- Usage of object oriented methods
- Functionality
-
Your app should read all data from the given CSV files into a meaningful data structure/s.
-
Print out all orders (we want order_id & order total)
-
Find an order by its
order_id. -
Find all orders by their
customer_email’. -
Print out all orders and items sorted by
order_id. -
Print out total revenue (Sum of all order totals)
-
Use jest at least to test 1 method
Hint: Optional means optional.
-
Write Unit tests for at least another method.
-
Implement an interactive user interface for one or more of the main tasks mentioned above. This could be done by a website, on the console, etc.
-
Add a new order to the data structure of your software (via command line or UI) and export it to a new CSV files.
- Clone this repository with local branch:
git clone https://github.com/echocat/its-nodejs-kata.git
git checkout -b run-<yourname>
If you want to refactor each iteration you can use
git checkout -b run-<yourname>-<iteration number>
# Example: git checkout -b run-candidatename-1
-
Open in your favorite IDE.
Hint: We recommend Visual Studio Code.
-
Happy coding!
npm start
npm lint
npx jest --coverage
- Build the app.
yarn run build:cli
- Run the cli tool and show help page.
node dist/cli.js -h
node dist/cli.js --findByCustomerEmail useremail4@example.com
node dist/cli.js --findByOrderId 12314327
node dist/cli.js -ot
node dist/cli.js -owi