refactor: remove * from application identifiers #74
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.
Asterisks appearing in the application identifiers were not properly handled. Summary of the issues:
326*
. The existing implementation will accept any value in place of*
, but in reality only a number in the range 0-5 is a valid match.*
, for instance in the pattern391*
the*
may be any number in the range 0-9.*
, because a queried key3261
for instance will then be translated into326*
, losing the last digit, which is needed when doing the lookup.Summary of the summary: the existing implementation doesn't specify which values
*
may correspond to, and information is lost during query key validation.The solution presented in this pull request is to remove asterisks from the system rather than trying make it work. The main drawback with this approach is that it considerably increases the size of
enum class GS1Elements
(from 200 to 527 elements). The main benefit it that it fixes the above problems with next to no changes in the parsing logic.