I am working on a leveling system where user will be leveled up whenever they reached certain amount of points, says when he/she gained 100 points will be leveled up to Level 2.
For this I was able to do the leveling "real time", as I will check if any new points added to the table, system will calculate whether he/she meet the criteria.
But now, there is a level down scenario, where, if user failed to upgrade to next level before current level expired (indicated with an expiry date and time), the user will be leveled down. I was able to do this if I set all the level expiry time to midnight(12 a.m.) and run a job to scan through all the users to check if any of them have to be leveled down.
My question is, if I allow the level expiry time to be not only midnight but follow the time he/she leveled up, says if user leveled up to Level 2 at 2016/3/24 9:30 a.m., the level expiry will be 2016/4/24 9:30 a.m..
In this case, how can I check if this user should be leveled down, if this user does not login or gained any new points by that time? I cannot set any job for this leveling down since all users can have different expiry time.
Thanks in advance.