New course! Every coder should learn Generative AI!
Try a free lesson0
I dont know what programming language your referring to but from what I understand: the user can input "Expiration Date" but not the "Best Before"?
Ans. You should do a Semantic validation where it enforce correctness of their values in the specific business context (e.g. start date is before end date, price is within expected range) and just add a restriction within the code in "Best Before".