Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add facility reviews #4

Merged
merged 5 commits into from
Sep 23, 2021
Merged

Add facility reviews #4

merged 5 commits into from
Sep 23, 2021

Conversation

mathias234
Copy link
Contributor

@mathias234 mathias234 commented Sep 21, 2021

Add the FacilityReview model
This model holds a review for a specific facility in a space.

This PR also contains a first stab at implementing a system for aggregating facility reviews.

@mathias234 mathias234 self-assigned this Sep 21, 2021
@mathias234 mathias234 marked this pull request as ready for review September 21, 2021 13:32
Copy link
Member

@DanielJackson-Oslo DanielJackson-Oslo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool work! (See comment about overly shortened variable names. To me they make those parts of the code less readable than it ought to be)

I think we can do aggregation a bit more nuanced, either in it's own PR or before this one merges. How we would aggregate wasn't specified, and I like this first stab at it for it's simplicity - but think it might be better to aggregate based on a % of positive reviews, and not just on the binary existence of a single negative review.

Aggregation as % of positive reviews

In my mind it was handled something like this, but that might add more complexity than it's worth?

We take the last 10 reviews.

Out of those, how many were positive?

If the ratio is above 80%, set it as likely.

If the ratio is below 30% set it as unlikely.

Anything else, set it as maybe.

If no reviews, it is unknown (obv.)

They don't have this at all

Then there's the special case of "They don't have this at all", or was_not_available in your code.

That's not merely a negative result, but more like a "you won't ever be allowed, as this facility does not even exist".

It should probably have it's own aggregation state beside unknown, unlikely, maybe and likely. Something like impossible. I've added code to reflect that in my PR #3 . If enough people say it doesn't exist (over 50%?), then it should be marked as impossible - not only not allowed to use.

Does that make sense?

@mathias234
Copy link
Contributor Author

mathias234 commented Sep 22, 2021

RE: Aggregation as % of positive reviews
I do think this makes sense, but it is probably an improvement we can do in the future, maybe once we have some proper data to test with and tweak the percentages.

RE: They don't have this at all
I think it makes sense to have an impossible state, I will add that to the model and the service

@DanielJackson-Oslo
Copy link
Member

RE: Aggregation as % of positive reviews
I do think this makes sense, but it is probably an improvement we can do in the future, maybe once we have some proper data to test with and tweak the percentages.

RE: They don't have this at all
I think it makes sense to have an impossible state, I will add that to the model and the service

Sounds like a good solution! 👍

@asolvang
Copy link
Contributor

Add facility reviews

Copy link
Member

@DanielJackson-Oslo DanielJackson-Oslo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants