-
Notifications
You must be signed in to change notification settings - Fork 1
Add validator for Belgif openapi-employment-identifier EmployerId #240
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with employerId, I can't be sure your checksum verification are correct.
...em-validator/src/main/java/io/github/belgif/rest/problem/validation/EmployerIdValidator.java
Show resolved
Hide resolved
I based it on https://www.ict-reuse.be/nl/service/smalsutils-validation. For example, in that library I also found "NssoCuratorRegistrationNumber" which does a different checksum calculation (it adds 5000000 before calculating the checksum). But I don't know if NssoCuratorRegistrationNumber is considered an EmployerId? @pvdbosch could you ask a review from someone from Smals/RSZ? |
|
| // Belgif openapi-employment-identifier EmployerId already enforces 197 -> 5999999999 range: | ||
| // we only need to validate the checksum here | ||
| int checksum = (int) (getValue() % 100); | ||
| if (!(checksum == calculateNssoChecksum() || (isInPlaRange() && checksum == calculatePlaChecksum()))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to smalsutils-validation there is overlap between NssoNumber range and PlaNumber range,
so I chose to also allow NSSO checksum when isInPlaRange() is true.
I don't think it is. From FedVoc employerId definition: "Definitive or provisional NSSO number, assigned to each registered employer or local or provincial administration." So this would correspond to NssoNumber+ProvisionalNssoNumber+PplNumber in smalsutils-validation.
I can ask for an analyst to provide answers to business questions, but not for a code review because the analysts are no developers and we're not using this module. Aside from the question about NssoCuratorRegistrationNumber, I can ask to plan adding an equivalent EmployerId validation to smalsutils-validation. Are there any other questions you'd like to be answered? |
Maybe a review from a developer that works on smalsutils-validation? I am mainly looking for some assurance that the checksum verification logic has been implemented correctly. |



No description provided.