The documentation (including example and pitfalls) for this topic is here:
https://docs.timefold.ai/timefold-solver/latest/using-timefold-solver/modeling-planning-problems#valueRangeProviderOnPlanningEntity