Closed JDGrimes closed 7 years ago
Probably there should also be minimum and maximum settings, so that a user can have the number of points be the number of dollars spent on the purchase, but no more than 50 and no less than 5. So if they spent just one dollar, they'd still get five points, and if they spent 100 dollars, they'd still get just 50.
The real issue here is going to be deciding how best to handle rounding in cases when we are dealing with a decimal value and not an integer. Even when we are dealing with an integer, the user may want to have a ratio of 10:1 or 2:1, etc. So there again will need to use rounding. I guess we could let the user select how to round, up/down/ceiling/floor/etc. Other options could be added, too, I guess.
The min and max thing could actually be achieved using multiple reactions. However, multiple reactions may not always work as the user wants them to, since they have separate limits, rate limits, etc.
I just keep wondering to myself whether this is really core material. It kind of seems like something that could go into a generic module, not a basic feature that ought to be in core. We do, at the very least, need to make it possible to handle this gracefully though.
I'd say the best thing for us to do here is to work on it as if it was a module. That will force us to make our APIs extensible. Then if we decide to fold it into core one day, we've still forced ourselves to make those improvements.
Well, we've created the module, and I think that this will stay as a module, for now at least. We've made the changes in core necessary to make it happen. So let's close this.
Previously: https://github.com/WordPoints/hooks-api/issues/25
Related: #248