Open dimak1 opened 4 months ago
Roland also has a list @rstens to add to this ticket
Screen Validation Check Points related to Validation Conditions
Screen Validation Check Points related to Navigation Conditions
Screen Validation Check Points related to Usability Conditions
Screen Validation Check Points related to Data Integrity Conditions
Screen Validation Check Points related to Modes (Editable Read-only) Conditions
Alexis working on a spreadsheet for field validations
The Social Insurance Number (SIN) was created in 1964 to serve as a client account number in the administration of the Canada Pension Plan (CPP) and Canada's varied employment insurance programs. In 1967, Revenue Canada, now called Canada Customs and Revenue Agency (CCRA) Canada Revenue Agency (CRA), co-opted the SIN and started using it for tax reporting purposes.
The only legislated uses of the SIN are: Canada Revenue Agency, your employer for Income Tax reporting, banks (with some exceptions), Social Assistance programs, and a few other government and/or tax related agencies.
Algorithm Social Insurance Numbers and Business Numbers are validated via a simple checksum process. This SIN algorithm is commonly known as the LUHN algorithm or the mod-10 algorithm. It also happens to be used to validate Credit Card numbers among other things.
Let's use this fictitious SIN to demonstrate:
925 545 212
9 2 5 5 4 5 2 1 2 Multiply each top number by the number below it
1 2 1 2 1 2 1 2 1
9 4 5 1 4 1 2 2 2
Notice here that 5*2=10, add 1 and 0 together and get 1. If you get a 2 digit # add the digits together.
Add all of these digits together.
9+4+5+1+4+1+2+2+2=30
If the SIN is valid this # will be evenly divisible by 10.
30/10 = 3 so this is a valid SIN.
The SIN algorithm can be arranged to generate as well as validate.
The first digit of a SIN indicates province of registration.
1 = NB, NF, NS, PE (1 is also used for Business Numbers BN) 2 = QC 3 = Not Used? QC? 4 = ON 5 = ON 6 = AB, MB, SK, NT, NU? 7 = BC, YU 8 = Used for Business Numbers (BN) 9 = Immigrants & other temp SIN's 0 = Not Used
Is identical to SIN but only starts with an 1 or an 8.
Or in code:
function validateSIN(sin) {
// Remove non-digit characters
sin = sin.replace(/\D/g, '');
// Ensure SIN is exactly 9 digits long
if (sin.length !== 9) {
console.log("SIN must be 9 digits.");
return false;
}
// Convert SIN to an array of numbers
const digits = Array.from(sin, Number);
let total = 0;
// Loop through each digit
digits.forEach((digit, index) => {
if (index % 2 === 0) {
total += digit;
} else {
const doubled = digit * 2;
total += doubled > 9 ? doubled - 9 : doubled;
}
});
// Check if the total is divisible by 10
const isValid = total % 10 === 0;
console.log(`Total: ${total}`);
console.log(`Is SIN valid? ${isValid}`);
return isValid;
}
// Example usage:
let str = "430-837-013";
validateSIN(str);
Here's the spreadsheet (draft) with validation rules- https://bcgov.sharepoint.com/:x:/r/teams/09399/Shared%20Documents/Product%20Team%20Chat/Field%20validation.xlsx?d=wd73427566b6148b48776b7c8682de8e9&csf=1&web=1&e=hstBhY Have a few questions for the product team, and I want to check in with design team tomorrow to check if address if captured anywhere else
what is our next step?
@rstens Do we need this or can I close it. I feel like it's going to be addressed through the testing that we are doing.
@mbertucci We can move out-of scope for Dec 15. I would not close this but leave it in the backlog. This is far from being dealt with.
There is a key issue with validations: Handling of validation during the steps and in the steps. The issues with that is that it actually can cause potential serious data issues. (There is a ticket for this).
Discussed with Mikaela, Stefanie and Scott - Oct 15th. Save this for after December 16th.
Find opportunities for field validation
Review what we have and meet with us to define what validations should be in place.
1) Formatting validations 2) Required field validation 3) Document upload - we aren't checking or validating that they uploading the correct documents.
Spreadsheet with validations create a POC and then Design to meet with PO BA
Group those validations by page And then move them to refinement