I disagree. If you don’t manage contracts correctly, I doubt you can make payslips.

Not sure to fully understand here. Do you think this can be managed by a employee leave management module?
Contracts, leave, holidays and legal.
For example; you work on Sunday : 25% more, different fiscal rule, and 1/2 a day off as compensation.
Another one: You get credit for training, you use part of it, and during this training you don’t benefit of lunch tickets. and so on…

To properly integrate expenses on payroll first we need a module to manage expenses.
yes indeed
This is why I mention it.

Sorry but I do not understand you here. Did you mean that it’s needed to have a report to sumarize the expenses related to payroll?
Not only (part of) expense. Totals of paid, raw, different total for pensions, fical fees and so on.
Part of expense is in because it may be reincorporated in salary (company car, tele-working expenses etc…)

I will prefer to have it on the database
Importing rules from csv format ?

Did you think it’s worth having a look at it?
It may be of interest because it is similar to what you propose.
-
a video about Odoo proprietary payroll https://www.youtube.com/watch?v=sHoAr0cS2B8
-
a video about localizations Building l10n Payroll Structures from the Ground Up | Odoo
-
and code from community
Odoo 13 Payroll | Odoo Apps Store
Odoo13 Payroll | Odoo Apps Store