The objective for this challenge is to convert a small set of data from CSV format into a database, mapping the data according to the given specifications.
Read everything properly. Proper analysis of requirements and data is half the work.
data - folder containing the CSV files to read and convert
specs - specifications for the data format to store in database
src- all your code should be placed in this folder
tests- folder for the tests
convert.php - command to start the conversion
Clone this repository and develop the solution in your own repository
Install Docker in your machine
Build and run the Docker instances with:
docker-compose up -d --buildWait for it...
After the instances are setup you can run commands using:
docker-compose run --rm console <command>Lets run composer update for example:
docker-compose run --rm console composer updateYour code should be placed in the /src folder
Open
converter.phpand call your code thereYou can run the converter with
docker-compose run --rm console php convert.phpYou can run tests with
docker-compose run --rm console ./vendor/bin/phpunit testsMonolog is available and logs are stored in
app.log. Use it at will.Good luck!
Don't reinvent the wheel. Feel free to install whatever packages you might require.
Use an ORM or ODM to access Mongodb.
We recommend Xenus but choose your prefered one from:
Be pragmatic in your approach while keeping an eye on SOLID principles.
Without over engineering use OOP best practices to organize your code (interfaces, abstracts, models, etc).
Write at least some basic unit tests for your solution.
Only map data that is directly available on target, skipping all that is unneeded.
Challenge is complete if we see all data correctly stored in Mongodb collections according to the
specs
The following is OPTIONAL but will be highly valued in your application
Change the type of transactions that are invoices. Feel free to explore the data to find that info.
Add the current balance to the accounts. Feel free to explore the data to find that info.
mongodb://dsw_challenge_mongodb:27018/dataswitcher
You can use Robo 3T https://robomongo.org/ to check your work
Use localhost:27018 for connection.