User defined enum type in codeless

In my application I need some enum style data fields in the database. Because there is none and I don’t wanted to enter the same integer number in all handlers for the database, I used a custom function with many boolean inputs which returns the specific number.
Wound’t it be interesting to have for these kinds of problem to have an enum type variable or custom function like construct which can be defined by the user and returns an integer for the specific property everywhere it is called (as in most common programming languages).

Thank you for idea, we will think about it.