-
Notifications
You must be signed in to change notification settings - Fork 308
use an ENUM for is_suspicious #567
Comments
Using How about changing the variable name to |
I'm 👍 for this, I think it would make some of the code simpler, and we should be able to get rid of some of the SQL in the ORM .filter methods. As it happens, SQLAlchemy also has built-in support for using Enum column types :) |
I was thinking the property attached to the participant account overall, not just their credit card info. We also don't want to pay out to bank accounts attached to suspicious accounts. I think we keep it as is_suspicious for now, and maybe in the future it becomes more sophisticated, like a trust weighting or some such. How about
|
This is related to issue #588. We need to be clear what the business rules are for avoiding fraud. Here is a sketch of a gittip user's path to legitimacy. I'm assuming that we only care about user legitimacy for moving money into or out of Gittip. A user who has neither a credit card nor a bank account tied to Gittip can receive tips and re-gift those tips to others. No review of such a user is needed. Once a user is setup to move money into or out of Gittip, we need to check if the user appears suspicious. Precisely speaking that means the user has outgoing tips pledged and a credit card on file or the user has incoming tips and a bank account connected to Gittip. I think we want to be proactive about reviewing accounts. We should review any account whenever it first adds a credit card or bank account, regardless of pending tip activity. I see four states of legitimacy here:
|
You and @joonas are in cahoots, aren't you? ;-)
This is good to have on the table. We haven't really provided for this yet. Another case:
|
I believe the first two states of the four you list are currently handled by checking whether the participant has a card/account attached (specifically, either |
Good question! No. In general I prefer storing events and figuring out state at runtime. Most of the events I described are participant actions: joining Gittip, adding a credit card, adding a bank account and my proposed request appeal of being locked. I wanted to be clear (that business rules thing again 😄) about when we need to check the legitimacy of a participant. The event currently stored in I'd rather have our participant review stored more completely as an event. Who reviewed the participant (even if this is automated as some point, record it as such), when, what was the outcome (legit or suspicious) and maybe some free text commentary about the review.
This is another event: our learning of a compromise for a participant. We'll need to lock the account. This has the potential to be messy. There are several different possible compromises. I doubt we want to guess in advance all possible compromises. Some examples:
Anyway, a compromise is also an event. I assume our reaction is the same: fully lock the participant account. It's starting to sound like we should add a new database table to hold legitimacy decision events. Is that too heavy? I guess we could denormalize current state into each participant's |
This is great advice. I've been sort of stumbling towards this but hadn't cognized it so clearly. Thank you! :-) I implemented tips this way more or less accidentally, but I've liked it so much that I've ticketed converting other pieces of data to this model (#141, #342, #343). My next question here then is whether you end up with a single |
There's nothing wrong with caching some things, especially if the calculation is non-trivial, changes are infrequent, but it is accessed often. You must ensure the cache is generated and gets updated automatically; there can't be human effort required for maintenance (after the initial setup). |
Relevant: "Event Sourcing"
http://www.martinfowler.com/eaaDev/EventSourcing.html ht @seejee |
TODO: Actually store the email address and send email with confirmation link
We've lived with |
We have three states for is_suspicious:
We should us an ENUM instead of a boolean for that (this was raised on an HN thread when we announced the Delpan Incident).
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: