Add a validate function to order model.