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

Enforcing monthly/weekly budget? #5

Open
geekdave opened this issue Aug 7, 2015 · 1 comment
Open

Enforcing monthly/weekly budget? #5

geekdave opened this issue Aug 7, 2015 · 1 comment

Comments

@geekdave
Copy link
Contributor

geekdave commented Aug 7, 2015

I love the idea of letting the team organically figure out what kind of bonus amounts fit what kind of situation. But to get this funded by the higher-ups, I'll need to provide some reassurance that costs won't run amok.

I understand that there's a HUBOT_HIGHFIVE_DAILY_LIMIT which controls how much any single user can give out in a day. However, it seems this wouldn't exactly help to control a monthly budget.

What I'm looking for is a way to add another condition, to make sure that a gross monthly (or even better, weekly) budget is not exceeded before approving a highfive.

Just wanted to check if there was any reason not to do this, or if it was possible already in some way.

If not, and the answer is "PRs Welcome!" I'll happily get right to it!

@ben
Copy link
Owner

ben commented Aug 9, 2015

Right now there are two limits. The per-gift limit (HUBOT_HIGHFIVE_AWARD_LIMIT), which defaults to $150 (or €150, I guess), and the daily per-person limit (HUBOT_HIGHFIVE_DAILY_LIMIT), which defaults to $500. So the maximum that would be sent out is $500 per employee per day, but with larger organizations that turns into real money pretty fast.

I don't see a good reason not to add a global per-day limit. I think the default should either be 0 (no limit) or some number of dollars per employee; you could look at robot.brain.data.users, which should contain every user that Hubot has seen talking. Anyways, the code you're looking for is in record_daily_total.

(Also, I went ahead and gave you a commit bit and added you to the NPM project. Use them wisely. 😄)

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

No branches or pull requests

2 participants