I would like my app to have different price tiers, with each tier having a maximum number of times per day that a person can do a particular action, such as start a chat with a new person.
How do I limit the number of times an action can be performed per time period (in my case per day?)
I haven’t started yet actually, nor decided on which other actions to control. I actually mean to limit the number of times a user can start a chat with a new user: 3 new chats per day. He could still access old chat conversations.
I would have a table of UserActions with a relationship.
Every time a message is sent then you create a record in UserActions. UserSend, UserRcv, Date, Newchat?
Then on the ‘Send Message’ button you need a condition, to evaluate the number of records in that table, pertaining to the logged in user
OR you could maybe do it all on the Users table, with a count field that is reset from the Send screen Action and a record of last reset date.