GrLdev / Rate-My-Student-Home

A website designed to allow students rate their student homes in Cardiff.
3 stars 0 forks source link

Plan how to handle rent, bathrooms, and bedrooms #93

Closed theobaur13 closed 1 year ago

theobaur13 commented 1 year ago

We rely on self-reporting for rent, bathrooms, and bedrooms at the moment. On the Find a review page we probably want to list these stats about the property, the issue is that there may be many different self-reported rent, bathrooms, and bedrooms.

Currently, each house and hall has a rent, with the house containing bathrooms and bedrooms, then in the create review page. If the user enters a new rent, bathrooms or bedrooms for a property that already has these assigned then the most recent values are discarded, essentially meaning that the first person who has entered the review for a property will be the only person able to affect these values.

Instead, I propose that we add a rent column to the review class so that if the rent changes (which it probably will every year) previous prices are recorded. Then, when multiple users add reviews for the same property, the most recent rent value from the review will be applied to the rent column in house or hall, the most recent bathrooms and bedrooms values will also be applied in the house class. We can also add columns for bedrooms and bathrooms in the review class but this is not as necessary because these values don't tend to change.

With this proposed solution we can display the previous rents for the property in the Find a review and browse pages alongside the review