ylaifa / reliev

1 stars 1 forks source link

Create a rating system #40

Open OnyJ opened 4 years ago

OnyJ commented 4 years ago

Why ? To get an opinion of the provided massage from the employees. This system ensures to have a good quality service from the masseur and confidence from companies.

How

Test the system in console :

>> rails console --sandbox
>> Masseur.create(email: "test@example.com", password: "123456", password_confirmation: "123456")

# Then create MasseurProfile : take the ID of the last created masseur
>> Masseur.last
>> MasseurProfile.create(masseur_id: the_id_of_the_last_created, first_name: "toto", last_name: "test", description: "Text written to fill the description attribute text text text", authorized: true)

# Do the same steps to create the Employee 
# 1. Employee.create(...)
# 2. EmployeeProfile.create(...)

# Test the Rating system : 
# Create multiple employees :
>> Rating.create(employee_profile: Employee.last, masseur_profile: Masseur.last, rating: 4)
>> Rating.create(employee_profile: Employee.last, masseur_profile: Masseur.last, rating: 2)
>> Rating.create(employee_profile: Employee.last, masseur_profile: Masseur.last, rating: 3)

# Calculate rating :
>> MasseurProfile.last.average_rate

# You should have this result : `3`.

Must Have A functionnal rating system to allow employees rating masseurs.

Reading List

billzero commented 4 years ago

Votre système ne marchera pas bien ainsi conçu.

A reprendre.

OnyJ commented 4 years ago

On a pensé à différents moyens de le faire mais on voulait t'en parler pour définir comment on allait procéder (via la prochaine conférence).