Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop zeroing last digits of RCNs without variable parts #97

Merged
merged 5 commits into from
Sep 8, 2021

Conversation

jodal
Copy link
Owner

@jodal jodal commented Sep 7, 2021

No description provided.

@jodal jodal self-assigned this Sep 7, 2021
@codecov
Copy link

codecov bot commented Sep 7, 2021

Codecov Report

Merging #97 (31d9bb4) into main (3c9e8d3) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #97   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines          771       784   +13     
  Branches       109       113    +4     
=========================================
+ Hits           771       784   +13     
Impacted Files Coverage Δ
src/biip/gtin/_rcn.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c9e8d3...31d9bb4. Read the comment docs.

Copy link

@aksell aksell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read over, and without having read the standard myself this looks very sensible 👍

@pytest.mark.parametrize(
"rcn_region, value",
[
(RcnRegion.NORWAY, "00012348"),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we expect 00 to be kept untouched? It does not seem like one of the company prefixes

RCNs with GS1 Prefix 04 or 40-49 have semantics that are only defined within
. Is this just a bogus value your testing ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. It's an RCN-8, which are GTIN-8 with the prefix 0 or 2, which are both Company RCNs. I'll double-check the standard and update the docstring.

@jodal jodal force-pushed the fix-rcn-zeroing-nonvariable-numbers branch from 1412442 to 31d9bb4 Compare September 8, 2021 11:47
@jodal jodal enabled auto-merge September 8, 2021 11:48
@jodal jodal merged commit 4c854e7 into main Sep 8, 2021
@jodal jodal deleted the fix-rcn-zeroing-nonvariable-numbers branch September 8, 2021 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants