fix: Order type restriction conflictive code #18086
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was experimenting and added a new
order_type
via property setter, but when I saved my new order with my brand neworder_type
, it turns out that there is a hardcoded validation in the code. I was surprised, should it be there? Does a reason for it exists?If there is no reason for it to exists then this PR can be merged to permit the users to create their own
order_type
.If there is a valid reason, I think that we should discuss it, because is probable that there exists a better way to solve it. This is not only bad for the users that can't add a new order_type, it's bad because is code that should be maintained. For example, if tomorrow we decide to implement a new
order_type
, we should change this code too, and that's something more to remember and, because of that, bad.Please, share your ideas.