Open felsspat opened 7 years ago
Hi @felsspat , this could be a solution but I'd like to have all in this library because I think it's a responsability of it. What I'd prefer is to have a PartialChecker
and a PartialCalculator
that extends the main Checker
and Calculator
, to only check/calculate partials of codice fiscale. What do you think of it?
/cc @gadiener
Hi @gadiener, thanks for answering!
That would be great too. Since we don't have the place of birth and the birthday of our customers all I'm doing now is a check of the name and the checksum.
$calculator = new Calculator($person);
$nameString = $calculator->calculateSurname() . $calculator->calculateName();
if (substr($taxId, 0, 6) !== $nameString) {
return false;
}
if ($calculator->calculateCheckDigit(substr($taxId, 0 ,15)) !== $taxId[15]) {
return false;
}
This is related to #10.
Hi @DavidePastore,
yes, I agree with you. Separating responsibilities by extending the main classes seems to me to be the right approach. I think this should be done in the application domain and not in the library. However we should modify the visibility of those methods to allow their use in subclasses.
What do you think?
Hello @DavidePastore, I would like to make partial checks as well, can I send a PR making those methods (calculateSurname
, calculateName
, calculateBirthDateAndGender
) at least protected so we can extend the Calculator
class?
Hi,
could you please make the functions like calculateSurname() and calculateName() public? The reason is we don't have the belfioreCode or birthday of our Italian customers, but we want to check the rest of the code.