Let's say that in a project we have a function (in PHP for example) that checks whether a particular user is eligible for a discount.
Also, we have a report (written in SQL) that pulls all users that are eligible for discount.
At the beginning of the project, the logic in the function and the SQL is identical, no issues.
One year later, we decide to make changes to the logic, so we do it in our function. Now, what is the proper way to remind ourselves that the SQL in the report has to be updated as well (especially in large projects, where the duplicate logic might not be easy to track)?
Obviously, I can just put a comment, but is this the proper way?