emmastrienko / sorting-ecommerce

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem Statement

​This challenge, you are going to work on one of the e-commerce product list and need to write an application which can read from the CSV file and after processing and cleaning the data set, can sort on the data set by price and product ratings. The file is available as a CSV(Comma Separated Value) file, available in the folder named data and is called flipkart_product_sample.csv.

In this challenge, you need to read the data from flipkart_product_sample.csv sort the desired data and write the sorted data in another txt file The file contains the following information:​

pid - contains the unique product ID​

product_name - contains the product name as it is displayed on the site​

brand - contains the brand of the product being sold​

product_url - contains the URL for the product.​

retail_price - contains the retail price excluding any discount​

discounted_price - contains the discounted price excluding any discount​

product_rating - contains the product_ratings. product_rating can be ranging from 1 to 5. However, there are several products which does not have any rating. In those cases, the ratings should be considered as 0.

Tasks

Write a method to sort the list of products based on it's price. Please note that the sorting can be done in either ascending or descending order. After sorting, it should write the sorted result in a 'sortedPrice.txt' file.​

Write a method to sort the list of products based on it's rating in descending order only. After sorting, it should write the sorted result in a 'sortedOnRating.txt' file.

Instructions

1.Download and unzip the boilerplate code.

2.Run the command npm install to install the dependencies.

3.Open the boilerplate code in VSCode to develop the assignment solution.

4.Write the logic in .js file present in src folder

5.Read the .csv file given in resources folder

5.Run the test scripts available under src/test by giving the npm run test command in the terminal to test locally.

6.Refactor the solution to ensure all test cases are passing.

7.Zip the solution code with the name same as the assignment name.

8.Upload the zipped solution for submission.

"# sorting-ecommerce"

About


Languages

Language:JavaScript 100.0%