Update docs and implementation for Coordination Number
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
- [x] Update the implementation not to allow to high days
- [x] Decide on how to handle month/day == 00.
- [x] Update test data.
- [x] 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.
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.
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.
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.