I am looking for a solution following best practices to simply periodically validate database entries against some business logic. For instance, I have the database with employees, and another table with incoming calls. My service should periodically run the validation task (or tasks, it might be a lot of business rules), which checks if we have missed call(s) for employee in "calls" table and sends a message to assigned employee.
My first thoughts was:
- Create some JobManager, which has such methods: "RegisterJob", "UnregisterJob", "ExecuteJob"
- Create "JobHandler" which takes job result and decides what to do (e.g. send a message in case missed call found.
- Create and implement "IJob" interface, which takes all the logic inside.
But, I think it is some kind of very simple and rough solution. Maybe, there are some better ideas?