Problem
This issue should serve as a checklist and sub-issue aggregate for the feature of being able to match users with tasks. The feature would be based on the idea of assigning skills to tasks and users, then matching them based on those assignments.
To elaborate, task authors, as well as project/organization owners and admins should be able to specify skills a certain task requires.
Similarly, users should be able to specify skills they possess.
This would enable us to match other users with projects and suggest projects for them to work on.
What we need for assigning skills to tasks - #670
Models
Endpoints
Policies (Authorization)
Authentication
What we need for assigning skills to users
Endpoints - All done
Policies (Authorization) - All done
Authentication - All done
Matching users with tasks
For this part, I am not sure if we should be doing most of it on the API or the client. It's the whole "which side is smarter" debate. I'm leaning towards this being done on the API.
We would require a module, for example, UserTaskMatcher with a &match_user/2
defmodule CodeCorps.UserTaskMatcher do
@default_task_count
def match_user(%CodeCorps.User{} = user, task_count // @default_task_count) do
get_list_of_tasks_with_most_overlapping_skills(tasks_count)
end
defp get_list_of_tasks_with_most_overlapping_skills(amount) do
# implementation goes here. probably a simple query initially
# join user skills and tasks skills, group and count by task, order by count
# limit the number of results to amount
end
end
We would also require an endpoint which calls this module and returns the results. It would require authentication, but not authorization.
The ember side would need to have a service module which would access this endpoint. There are multiple ways we could likely achieve it, but that's something to discuss in the related ember issue.
Problem
This issue should serve as a checklist and sub-issue aggregate for the feature of being able to match users with tasks. The feature would be based on the idea of assigning skills to tasks and users, then matching them based on those assignments.
To elaborate, task authors, as well as project/organization owners and admins should be able to specify skills a certain task requires.
Similarly, users should be able to specify skills they possess.
This would enable us to match other users with projects and suggest projects for them to work on.
What we need for assigning skills to tasks - #670
Models
TaskSkillmodel[:skill_id, :task_id]create_changeset- requires both fields. uniqueness on that specific combination of fieldsEndpoints
POST /task-skillsto assign a skill to a project - creates recordDELETE /task-skillsto remove a skill from a project - deletes recordGET /task-skills- to fetch all project skills (with coalesce support forhasMany)GET /task-skills/:idPolicies (Authorization)
contributormight be enough.Authentication
What we need for assigning skills to users
Endpoints - All done
POST /user-skillsto assign a skill to a project - creates recordDELETE /user-skillsto remove a skill from a project - deletes recordGET /user-skills- to fetch all project skills (with coalesce support forhasMany)GET /user-skills/:idPolicies (Authorization) - All done
Authentication - All done
Matching users with tasks
For this part, I am not sure if we should be doing most of it on the API or the client. It's the whole "which side is smarter" debate. I'm leaning towards this being done on the API.
We would require a module, for example,
UserTaskMatcherwith a&match_user/2We would also require an endpoint which calls this module and returns the results. It would require authentication, but not authorization.
The ember side would need to have a service module which would access this endpoint. There are multiple ways we could likely achieve it, but that's something to discuss in the related ember issue.
TaskMatchermoduleGET /tasks/for-user/:idwhich calls module