Code Monkey home page Code Monkey logo

cleaners's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cleaners's Issues

Tasks CRUD

A Task is a small part of a service that will be ordered when you get your car to Cleaners.

Examples of tasks:

  • Wash a car
  • Wash a car's motor
  • Wash a car's chassi
  • Clean car's seats

So a task can have usually a name and price (how much will you have to pay if you choose each task).

For reference see: public/layout/servicos-tarefas-todos.html

Vehicle CRUD

A vehicle can be a car, truck, old car, SUV, etc that have to be cleaned.

Differently of most business, here at our company, a vehicle is the most important object, because where we will put some effort to clean it.

So, a vehicle must have a License Plate (this is very important to us to distinguish between many vehicles), usually we take note about the brand, color and model.

Customer CRUD

A Customer is someone who wants our service.

It is important to us store some relevant information of each Customer, like, name, email, birth's date, first date that a person became our customer, address, phone numbers.

For reference see: public/layout/clientes-todos.html

Tests should be country isolated

We cannot rely on specific country on our tests, we should isolate it, specially when we talk about labels.

It's still confusing for me the division on this app when we talk about the devise login gem. It has a lot of "labels", or translations, we could reuse (DRY) but also I don't know how we could leverage that.

Making public this repo requires licensing

So guys,

Think about the licensing. We just need to put on a file called LICENSES.TXT. However this is tricky, we need to chose between a lot of licenses, the best one that fits this app =)

Let me know your thoughts about it

Addresses, states, countries

Will addresses view have an index, edit and new html.erb's?

also, do you think it makes sense to separate those views pertained to addresses (country, states, cities, etc organized into one folder?

Addresses
    \__ Countries
              \__ _form.html.erb, edit, index, new
    \__ States
              \__ _form, edit, index, new
    \__ Cities
              \__ ...

Routing this in application would be

http://server/countries/edit maps to addresses/countries/edit.html.erb

Service CRUD

A Service is a job that will be done by our cleaning team, it is actually what we sell to people, that's our core business.

When someone wants his car cleaned, he comes to our cleaner area with his car, choose what kind of tasks we must do ( basic wash and use wax for instance) and pay for the service.

Thus, the service is composed by:

  • what vehicle
  • what tasks (can be more than one)
  • who is the customer (usually presented automatically because we know what vehicle)
  • total price of the service
  • other informations:
    ** date of the service
    ** any other relevant information that we would like to write down (i.e. do not use some detergent, must have be done until 5pm, be careful with rear mirror, etc)

For reference see: public/layout/servicos-todos.html

Address CRUD

This model could be an unplugged model and all the other models that belongs to the address model will create a foreign key to this model. Fo example, I'm a customer and I have an address.

So, it's necessary update the customer table with a foreign key to address table

class AddAddressToCustomer < ActiveRecord::Migration
  def change
    add_column :customers, :address_id, :integer
  end
end

And in the customer model define the relationship between these models. A little ruby code to demonstrate my idea:

# app/models/customer.rb
class Customer < ActiveRecord::Base
  # ...
  belongs_to :address
  accepts_nested_attributes_for :address, allow_destroy: true
end

And here is an example of the address model:

# app/models/address.rb
class Address < ActiveRecord::Base

  attr_accessible :country, :country_id, :state, :state_id, :street, 
                  :district, :city, :zip_code

  belongs_to :country # if this is a model
  belongs_to :state   # if this is a model
end

None attribute will be mandatory on address model. If the customer inform his address we will fill all the fields and persist them in database.

What do you think?

Associate a Vehicle to one Customer

A Vehicle does not exist without a Customer, because a Vehicle belongs to someone eheh.

In addition, a Customer can have many different vehicles.

The relationship would be better to do inside the Customer details (edit page).

For reference see: public/layout/clientes-detalhes.html

Use responders gem FTW

As Fabiano Almeida said:

If the actions use defaults behavior we don't need define these methods. The responders gem will do that for us.

and

We don't need to use respond_to. I installed responders gem to solve this for us. Take a look here. So, all actions for all controllers will respond to html. If we want to use other way, just put a comma after the last one and add the new way, for example:
respond_to :html, :json

So, what are we waiting for???

Need to create a database model

Things got a little messy - we forgot some model names, etc.

I suggest we create a small database model as a guideline for reference...

Are we forgetting to test?

Yes, I'm building without test as I'm learning again the basics. But no excuses, DO TEST seixasfelipe ! =)

Surround code with tests, not only empties *_spec.rb files!

Run rspec features for available languages

@seixasfelipe asked me a question on how we suppose to run rspec. Usually I do:

$ rspec -c

However, we suppose to run rspec features (yeah only features, translation is a feature that needs to be catched) for each country available in the application.

You can see the start of this work on de3f080, however I don't know how to proceed or if this is ever tested in ROR

I thought about something like:"

RSpec.configure do |config|
   config.i18n.available_locations do |locale|

and so on over rspec_helper.rb

How could we setup running feature specs for all available countries we have?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.