Add a validate function for order model.