Rails Pairing Project 1

What You Will Develop (1)

It's your product manager again! He comes with some more feature requests for you. Here they are:

1. Role

  • You will need to create a basic role management feature.
  • Once you have implemented this feature, seed it with two roles: administrator and customer.

2. User-Role Assignment

  • A user can have multiple roles. Administrator can assign roles to a user by editing user's data. You should modify user's create and edit page by adding checkboxes for roles.

What You Will Develop (2)

3. Modify User

  • Add an attribute to store Go Pay credit in User model.
  • Whenever Administrator create a new user, the user will have free credit with value of IDR 200,000,-.
  • Once created, administrator can not edit the value of user's credit. However, in user management page, administrator can click a "Top Up" button. When clicked, system will show a form to top up the credit. There, administrator can input the amount of credit he/she wants to add to the current account.

What You Will Develop (3)

4. Modifying Order

  • A cart now can only be checked out if user is logged in.
  • Once user is logged in, when user clicks "Place Order", order's user_id will be automatically assigned to current user's id.
  • If user select Go Pay as his/her payment type, system will check if user's Go Pay credit is enough to pay for the order's total price or not.
  • Only after all the checking in the previous point is passed can user's order be saved to the database.

What You Will Develop (4)

5. Modifying Order

  • Make sure users can only add foods from the same restaurant to the cart.
  • Use this gem, to calculate the distance between order's address and restaurant's address.
  • When order is placed, calculate the delivery cost with this formula: distance between order's address and restaurant's address (in km) * IDR 1,500.
  • Store the delivery cost to the order and add it to total price calculation.

On Pair Programming (1)

You're going to do this project in pair. Some thoughts on it:

1. It will not increase the speed at which you develop things, it should increase the quality of things that you develop.

2. In real work environment, you will face three possibilities:

  • You are paired with someone more senior than you. Try to learn as much as you can from him/her. Be proactive and open mind, and try to implement things as you are taught.
  • You are paired with someone more junior than you. Be a good mentor. Make him/her understand why both of you do things the way you do, instead of just make him/her typing what you command to.
  • You are paired with someone on par with you. Help and challenge each other to implement things in the highest standard.

On Pair Programming (2)

3. In real work environment, you will do pair programming with a lot of different people. Respect personal spaces between the both of you. Treat your pair as you want to be treated.

4. Particularly for this class, you may want to try taking turn with TDD. One person write one test, then the other make it pass. In the next turn, do the opposite. Discuss with each other why you write a test and a solution to make it pass the way they are.

How You Will Develop It (1)

Here are some rule of thumbs for you:

1. Be resourceful. You are going to develop things that you have not developed before in the classroom. Search around, don't rely on just materials from the classroom.

2. Having said that, when you encounter a problem that you never encounter in the class and you find a solution for the problem, you may be tempted to implement it directly. Don't. You can tinker with the solution you found, but don't forget to search around for the way to test it. When you're finally about to implement the solution, keep doing it in TDD fashion.

How You Will Develop It (2)

3. When faced with many new things to do, do not give up. Do the simplest thing that could possibly work first. The rest will follow.

4. Whenever you write something, always keep it simple.

5. Use the "you aren't gonna need it" principle.

How Your Project Will Be Judged

1. How many features you can implement in TDD manner.

2. How well you design solutions in OOP and MVC fashion.

3. How well you justify your OOP and MVC design.

4. How much of help you be to your team mate.

5. How well you present your app in English.

Rails Pairing Project 1

By qblfrb

Rails Pairing Project 1

  • 304