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

Update docs and implementation for Coordination Number #126

Open
4 of 6 tasks
PeterOrneholm opened this issue Apr 14, 2020 · 3 comments
Open
4 of 6 tasks

Update docs and implementation for Coordination Number #126

PeterOrneholm opened this issue Apr 14, 2020 · 3 comments
Assignees
Labels
Milestone

Comments

@PeterOrneholm
Copy link
Collaborator

PeterOrneholm commented Apr 14, 2020

Is your feature request related to a problem? Please describe.
After numerous emails with Skatteverket, we now have verified two things regarding Swedish Coordination Number:

  • Month=0 and day=60 are to be expected. This means month and day are set to 00 and they might be so when day and/or month can't be verified.
  • Days too high for a given month as found in the test data is not valid. The test data is invalid.

What area is it related to

  • Coordination Number

Describe the solution you'd like

  • Update the docs to describe that this is the official definition
  • Update the implementation not to allow to high days
  • Decide on how to handle month/day == 00.
  • Update test data.
  • Update unit tests.
  • Bring back Date and Age hints for CoordinationNumber

Major question is, can/should we bring back the hints? Now we now that only when month/day is 00 the data can't be verified. Can we return all hints, but throw an exception if date is not verified? It should be edge cases.

@viktorvan
Copy link
Collaborator

viktorvan commented Apr 15, 2020

Month can't be 60 right? It's Month = 0 and Day = 60, I think.

We also need to update the CoordinationNumber test-data to include numbers with month=0 and day=60, and remove numbers with days > DaysInMonth.

We should be able to handle the hints as you suggest.

@viktorvan
Copy link
Collaborator

viktorvan commented Apr 15, 2020

Also, I think there still is a missing requirement, but I am not sure if we can extract any more information from Skatteverket unless we want to end up on some list for blocked emails ;)

This is just an edge case, so maybe we can decide on it ourselves:

For a coordination day the valid MIN is 60.
For a coordination day the valid MAX is 60 + (DaysInMonth for month n). (where n is 1-12).
For a coordination day the valid MAX is ?? when month is 0.

Or have they actually confirmed that the only valid day is 60 if month is 0? I.e. can you know the day of birth, but not the month?

We can't be too strict here, because it could mean that we could parse a (potentially) valid coordination number as invalid, so without further input from Skatteverket I think we need to allow for any day number 60-91 if the month is 0.

@viktorvan viktorvan changed the title Update docs and implmentation for Coordination Number Update docs and implementation for Coordination Number Apr 15, 2020
@PeterOrneholm
Copy link
Collaborator Author

Month can't be 60 right? It's Month = 0 and Day = 60, I think.

Correct!

We also need to update the CoordinationNumber test-data to include numbers with month=0 and day=60, and remove numbers with days > DaysInMonth.

Yes!

We can't be too strict here, because it could mean that we could parse a (potentially) valid coordination number as invalid, so without further input from Skatteverket I think we need to allow for any day number 60-91 if the month is 0.

I think you are right - After the numerous emails just to get here I'm quite sure this isn't specified. I agree that we should not be too strict here.

@PeterOrneholm PeterOrneholm added this to the 3.0.0 milestone May 1, 2020
@PeterOrneholm PeterOrneholm self-assigned this May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants