-
Notifications
You must be signed in to change notification settings - Fork 6
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
Created Algorithm for Potential Partners in Beta Register Page #1177
Conversation
config/config.exs
Outdated
config :animina, :default_potential_partner_minimum_age, 18 | ||
|
||
# confugures the difference in age if no maximum or minimum age is set | ||
config :animina, :default_potential_partner_age_difference, 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean? If I am 50 years old will that mean that the range is from 40 - 60 or is it from 45 - 55? Either improve the actual code or add a better comment to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means range is from 40 and 60 , Kindly advise on the best naming to have in this case @wintermeyer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call it default_partner_height_offset
Not perfect but good for now.
config/config.exs
Outdated
config :animina, :default_potential_partner_age_difference, 10 | ||
|
||
# Configures the maximum height for potential partners | ||
config :animina, :default_potential_partner_maximum_height, 300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
300 as a default doesn't make any sense. Make it 120 please.
PS: There will come the day when I get an email from a user who has a height of 121 cm. I am so sure! ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case we want a value so huge that will make sure we do not leave out any users , we also use this value as the default maximum height in the query , this allows us to select all users below 300 cm , I think it would be best to have a very high value for this case , thoughts? @wintermeyer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick google research let to the number 251. That seems to be the height human right now. Let's go with 225 cm since the heightest German right now seems to be 224.
<%= with_locale(@language, fn -> %> | ||
<%= gettext("Minimum age") <> " " <> msg %> | ||
<%= gettext("Minimum height") <> " " <> msg %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ALWAYS(!) use something like gettext("Hello, %{name}!", name: "Meg")
for this kind of thing. All languages are different. There is no way this order will not change for all languages.
@wintermeyer , kindly have a look |
Untitled.design.1.mp4
@wintermeyer , finished up on the algorithm which works as such
1. Gender
The first selection is gender , by default, the partner gender is set to male , we then filter all records to only bring male ones
2. Age
If a user selects their age eg 20 , we add and minus 10 to get the maximum and minimum age if these are not selected , if they are , we use the maximum and minimum age that the user explicitly selects and filter users against it. We have the difference to add set in config.
3. Height
If a user selects their height eg 160 , we add and minus 10 to get the maximum and minimum partner height if these are not selected , if they are , we use the maximum and minimum height that the user explicitly selects and filter users against it. We have the difference to add set in config.
4. Search Range and Zip Code
If a user selects a zip code, but no search range , we use a high value as the search range , in this case
10000
, we have this set in the config , if the user selects the search range explicitly though , we use this value.The next step is to add validations to this page and move to the next page where a user completes their registration.