- install required dependencies by running the
bundle installcommand - create the database using the
rake db:createcommand - apply migrations to the database using the
rake db:migratecommand - run tests by executing the
bin/rails test -vcommand - run the
bin/rails servercommand to see whether the server starts
- build dev image:
docker build -f Dockerfile.dev -t dna-app-dev . - run image:
docker run --name dna-app-dev -p 3000:3000 dna-app-dev - run tests:
docker exec -it dna-app-dev rails test -v
Let’s imagine you are working on API for backend of an online payment system. The actors are: users (festival participants), merchants, event organiser. We want to enable backoffice operations to the event organiser.
Currently implemented:
- Users can make a payment (with a virtual currency) to a specific merchant.
- Our system has a payment log.
- It means that information about payments are stored in a database.
- This data can be used for reporting.
Please make a code review of the currently implemented solution.
Add new endpoint which give total income for payments for selected time period for given merchant.