I'm working on my final project for a course named Web Applications in ASP.NET.
Basically, it's a web application for shopkeepers to manage their clients' money accounts in their stores.
In order to open an account, the shopkeeper and the other person have to agree on the length of period for the account, the interest type rate and other variables.
For example, let's suppose that a person opens an account today and in two weeks, he has to pay for all the products he has bought. If he doesn't pay that day, he's charged a late payment fee. This late payment fee is charged every day until the person cancels his debt.
It's important to mention that a person can partially or totally pay his amount due before the closing day.
Now, how can I execute that action in my web application, so that it checks after a period of time if the user has paid or not and if he hasn't, it checks daily until the user has canceled all his debts?
This is the pseudocode for the action that I want to execute:
This pseudocode can be further improved, but I think it explains what I want to achieve
if today is the closing day for a user's account if user's account amount is 0 don't execute this task anymore and discard it else charge the person a late payment fee if today's date is greater than the closing day for a user's account if user's account amount is 0 don't execute this task anymore and discard it else charge the person a late payment fee
And also, should this action be executed on the database or the server?
I'm using Asp.Net MVC5 and IIS 10.0 for developing the web application. And for the database, I'm using SQL Server 2014.
I hope I made myself clear and if I didn't, please let me know. And by the way, English is not my mother tongue; please excuse any errors on my part.