I am creating a payroll application in .NET. One of the requirements is that the attendance and deduction rules should be dynamic and flexible to the most extent. The user should be able to define his own rules, where every employee will be bound to an attendance rule.
One solution is to compile C# code on the fly where the code to every attendance rule is stored in the database and compiled at run time, but this isn't the most elegant solution since the rules can only be read/understood by a technical person, also the performance and readability of the code will not be the best possible thing.
I am wondering if there is a solution \ architecture pattern that allows me to define and apply attendance rules and calculate the deductions based on them without writing scripts or dynamically compile C# code.