[Receipt] Auto lock user from making card transactions after hitting a missing receipt threshold
When a user hits a certain threshold of missing receipts, we will lock their user from making more card transactions. Under the hood, this will be implemented as freezing all their stripe cards and setting a "locked" boolean. The "locked" boolean will prevent the user from defrosting the card.
We still need to determine what this "missing receipt threshold" is. Maybe transactions.missing_receipts.where("date < ?", 3.weeks.ago).count > 20. This would give people a three-week period to upload receipts. We can send reminders starting at 2 weeks up until we actually lock their user from card transactions.
The goal is to encourage users to upload their receipts.
I agree with the general goal of this and I'm glad we're doing weekly receipt reports by default.
However, I think we should have a level of human intervention here and I think a human should manually switch them into locked mode after having reached out personally.
Sending purely an automated email feels impersonal and overkill, as a user that would frustrate me and could leave me feeling sour. I also have a feeling this would block some fairly prominent user's cards.
And on a technical note, there are still some weird quirks about calculating how many receipts someone is missing and it can't be done in SQL yet (though tasks might help this?).
I think the first step would be making ourselves clear with the deadline to upload receipts. As a user, it's not entirely obvious how long you have to upload a receipt because there's no feedback besides the act of uploading.
We built this: https://github.com/hackclub/hcb/pull/10609