Marketto / codice-fiscale-utils

Utility to handle Italian Codice Fiscale
MIT License
25 stars 11 forks source link

Invalid CodiceFiscale #102

Closed VerVera closed 5 months ago

VerVera commented 1 year ago

We are not able to validate one of our client with code "RCCLGU63T27I560K"

        console.log(Validator.codiceFiscale('RCCLGU63T27I560K').valid)  //output: false , expected: true
        console.log(Parser.cfToBirthPlace('RCCLGU63T27I560K'))//output: null, expected: SECONDIGLIANO
        console.log(Parser.placeToCf('SECONDIGLIANO')) //output: I560
        console.log(Validator.codiceFiscale('RCCLGU63T27I560K').matchBirthPlace('SECONDIGLIANO')) // output: true
Marketto commented 5 months ago

The Provided CF is valid for the Agenzia delle Entrate while Secondigliano became part of Napoli city in 1926 and the provided CF birth year is in 1963; probably due to the introduction of CF back in 1973: I will skip date/city validation for birth dates before 29 sept. 1973.