Let's build a very simple order management system having orders from pending up to completed state.
-
An order has a control number and a state.
-
When the order is added to the system, it has a pending state.
-
I want to be able to start the progress of an order.
-
I want to be able to complete an order.
-
I want to filter orders by number control and state.
-
A pending order can only go to in progress state.
-
An in progress order can only go to completed.
-
Completed orders are done and should preserve its state.
Create a github repo to develop your solution.
PS 1: Using a css library/framework is a plus.
PS 2: Tests are needed.
PS 3: We’ll evaluate everything from the git history to the implemented code.
-
Using SSH:
git clone git@github.com:Pauloparakleto/order-management-system.git
-
Using HTTPS:
git clone https://github.com/Pauloparakleto/order-management-system.git
On terminal run: bundle install
I don't have postgre locally on my Ubuntu Machine. Follow the instruction on the link and come back to the instructions bellow.
- Rename the file
database.sample.yml
todatabase.yml
- Set the password on the default area according to your password, mine is
12345
- Set the username on the default area to your role with privilege to create database. Mine is the default role. So I comment out the username line in order to postgre reach the name of my machine.
- Start database server:
sudo service postgresql start
Run: rails db:create db:migrate
Optionally you might populate the database with initial data: rails db:seed
.
However, you will not be able to test the create workflow since the delete action is not part of the
current release.
Any way, you may delete the data to restart the create workflow by running:
rails db:drop db:create db:migrate
Run: rails webpacker:install
Run: rails server
At least but also important, run the tests: rspec
If your integration test fails with webpack misses configuration warnings, run: rails webpacker:install