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

autoassign ready to review / test #30

Merged

Conversation

ben-pr-p
Copy link
Contributor

Auto assignment behavior:

POST https://text.berniesanders.com/autoassign with JSON body:
{ "slack_id": "USDF201", "count": 500 }

Possible responses include:
401: Unauthorized
500: No user found with slack id USDF201
500: There are no campaigns left to assign a tester to
200: { "numberAssigned": 500 or less }

Behavior beyond auth / user existing:
If there are no campaigns with unassigned contacts, throw an error!

If there are no campaigns with more that count texts left unassigned, assign this texter the number of unassigned texts in the campaign with the most unassigned texts (getting closest to the requested amount).

Else, of the campaigns with more unassigned texts than count, choose the one that has the smallest proportion of its texts assigned.

@ben-pr-p ben-pr-p requested a review from bchrobot February 14, 2019 15:48
@bchrobot bchrobot merged commit f85ffc8 into politics-rewired/deploy Feb 14, 2019
@bchrobot bchrobot deleted the politics-rewired/add-autoassign-api branch February 14, 2019 17:26
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