This programming challenge is designed to evaluate your skills as a software engineer, specifically in the area of web development with PHP and the Laravel framework. The challenge involves building a web application that generates a product report from a CSV file, and writing tests for the application using PHPUnit.
- Fork this repository and clone it to your local machine.
- Create a new Laravel application in the cloned repository directory.
- Write PHP code to read in the products.csv file located in the /storage/app directory and generate a product report in HTML format.
- The design of the HTML page is not relevant for the evaluation, feel free to show a simple table.
- Provide the same data, via api, /products, in order to run PHPUnit tests
- The product report should include the following information:
- Total revenue of all products
- Total revenue in the first half of the month
- Total revenue in the second half of the month
- Total number of products in each category
- Average price of products in each category
- Verify that the PHPUnit tests pass. Feel free to add more if needed.
- Push your changes to your forked repository.
- Notify the evaluator that you have completed the challenge.
- You have 90 minutes to complete the challenge.
- You may use any resources available to you, including documentation and Google.
- Your code must be written in PHP using the Laravel framework.
- Your code must be well-organized and easy to understand.
- Your code should adhere to Laravel best practices.
- Your code should be documented with clear comments and/or inline documentation ONLY where necessary.
- You can add more PHPUnit tests, if needed.
- You may refactor existing code/tests, if needed.
- Your code should be committed to a new branch in your forked repository.
- Do not cheat or plagiarize. The evaluator reserves the right to disqualify any submissions suspected of cheating.
- The PHPUnit test case passes without any failures or errors.
- The CSV file is read in and processed correctly, and the correct results are displayed in the view.
Your solution will be evaluated based on the following acceptance criteria:
- The program should be able to read in the input CSV file and store the data in an appropriate data structure.
- The program should be able to calculate the total number of products in each category.
- The program should be able to calculate the average price of products in each category.
- The program should be able to calculate the total revenue generated by all products in the CSV file.
- The program output should display the results in the specified format.
- The program should be written in a way that is easy to read, maintain, and understand by other developers.
- The program should be free of syntax errors, runtime errors, and logical errors.
- The program should be efficient and scalable, able to handle larger CSV files without performance issues.
- The program should follow good programming practices, such as using appropriate variable names, code commenting, and indentation.
- The program should use Laravel support libraries when necessary
- The program should be submitted within the given time frame of 90 minutes