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

Created Algorithm for Potential Partners in Beta Register Page #1177

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

MICHAELMUNAVU83
Copy link
Collaborator

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.

@MICHAELMUNAVU83 MICHAELMUNAVU83 marked this pull request as ready for review December 2, 2024 05:59
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
Copy link
Collaborator

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.

Copy link
Collaborator Author

@MICHAELMUNAVU83 MICHAELMUNAVU83 Dec 2, 2024

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

Copy link
Collaborator

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 :animina, :default_potential_partner_age_difference, 10

# Configures the maximum height for potential partners
config :animina, :default_potential_partner_maximum_height, 300
Copy link
Collaborator

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! ;-)

Copy link
Collaborator Author

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

Copy link
Collaborator

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.

config/config.exs Show resolved Hide resolved
config/config.exs Outdated Show resolved Hide resolved
<%= with_locale(@language, fn -> %>
<%= gettext("Minimum age") <> " " <> msg %>
<%= gettext("Minimum height") <> " " <> msg %>
Copy link
Collaborator

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.

lib/animina_web/potential_partner.ex Outdated Show resolved Hide resolved
lib/animina_web/potential_partner.ex Show resolved Hide resolved
@MICHAELMUNAVU83
Copy link
Collaborator Author

@wintermeyer , kindly have a look

@wintermeyer wintermeyer merged commit aab5b4f into main Dec 2, 2024
1 check passed
@wintermeyer wintermeyer deleted the beta-registration-filter-potentials branch December 2, 2024 16:31
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.

2 participants