chrisdesilva / pickup

App for finding nearby basketball courts for pickup games
MIT License
14 stars 28 forks source link

Issue #30: Court Rating #49

Closed mlimos closed 4 years ago

mlimos commented 4 years ago

Issue #30

Overview: Adding court rating functionality to the AddCourt and CourtModal components. The rating is on a 1-5 scale (only integers) and accepts a simple text input. When a rating is added, it is added to a 'ratings' array object and the average of these ratings is calculated to return an 'Average Rating' to the user. The user can also see how many people have rated the court.

Data Model Changes: In firestore, two fields are added to each court document: avgRating (data type of Number) and rating (data type of array, which holds a list of integer ratings). For those courts that already exist in firestore, the logic is designed to add these fields for the first time when a court modal is accessed.

Changes:

Future work: