Read a data file, process each record, and produce an output file.
The input file is in jsonlines format (http://jsonlines.org), with each record representing an ecommerce order. Each order contains data about the customer, shipping details, payment data, items purchased, and any applied discounts.
The file is available in AWS S3 at https://s3-ap-southeast-2.amazonaws.com/catch-code-challenge/challenge-1-in.jsonl
- PHP 7.3 or higher;
- PDO-SQLite PHP extension enabled;
- and the usual Symfony application requirements.
Download Symfony to install the symfony
binary on your computer and run this syntax
$ cd jsonlines-csv/
$ composer install
There's no need to configure anything to run the application. If you have installed Symfony binary, run this command:
$ cd jsonlines-csv/
$ symfony serve
Then access the application in your browser at the given URL (https://localhost:8000 by default).
If you don't have the Symfony binary installed, run php -S localhost:8000 -t public/
to use the built-in PHP web server or configure a web server like Nginx or
Apache to run the application.
Execute this command to run tests:
$ cd jsonlines-csv/
$ ./bin/phpunit