I am building a dating website and I have pretty much created and implemented all features but one. I need someone to build me a member matching system Here is how it should work:
1. Each member when creating an account is asked to fill in his/her partner preferences. - For example Partner should be aged from 22 to 26 years, should have a bachelors degree or higher, should be employed or self-employed, should be from a particular city or select cities etc.
2. When the member clicks on a Matches link, he/she should be able to see only those members who are not only within the partner preferences set by him/her, but also those members whose partner preferences match the users attributes. Essentially, it should only display 2 way matches. For example, say
a. User A is employed and looking for someone who is employed or self-employed.
b. User B is employed and selects "Doesn't matter" for his partner preferences as it relates to employment.
c. User C is unemployed and looking for someone who is employed or self-employed.
In this case, when each User clicks on his/her Matches link -
a. User A should be able to find User B but not User C (because A is looking for someone who is employed and B doesn't care of the other person is employed, however C is unemployed so he doesn't meet A's partner preferences).
b. User B should be able to find User A and User C (because B doesn't care about employment so both A & C are within is preferences).
c. User C can find only User B (because he does not meet A's preferences. But B meets his preferences and he is withing B's preferences).
The example above is pretty straight-forward, but I want the matching to be done for 8 preferences that Users will select:
1. Age from - Age to
2. Height From - Height to
3. Diet
4. Body Type
5. Drinking Habit
6. Smoking Habit
7. Marital Status
8. Kid Status
9. Religion
10. Education Level
11. Job Status
Note that each attribute in the preference can contain multiple values. Say for the partners religion the User can select multiple options so his partner can be of more than 1 religion. Similarly each attribute will also have a "doesn't matter" option which will by default select all options for that attribute or remove that filter when matching whichever works best.
I have a User model implemented and I am working with Postgres. All I want someone to do is to create a preferences model which will be nested under the User model. Id like someone to design the database structure for the preferences and design the matching functionality when the user clicks on the matches link. Any takers?