It might be preferable to allow reasons to be defined not only as records but also as enums or even as strings.
Therefore, instead of restricting the reason's type to Record, it should be changed to Object to accept any values.
Since identification using a switch expression is still possible, this should not cause any issues.