robertogallea / laravel-codicefiscale

Codice fiscale validation for php/laravel
MIT License
42 stars 16 forks source link

Added validation errors #62

Closed MoroAlberto closed 10 months ago

MoroAlberto commented 10 months ago

Description

Implemented distinct error codes and messages for validation errors related to missing first name, last name, date of birth, gender, and birthplace.

Motivation and context

The application consistently returns an 'Invalid codice fiscale' without providing any information to the user about what might be wrong

How has this been tested?

I have rigorously tested the changes by implementing the following test cases:

testValidationRequiresCorrectCfAgainstFormFieldsAndFailsOnWrongFirstName: This test ensures that the validation process requires a correct Codice Fiscale against the corresponding form fields and fails when an incorrect first name is provided.

testValidationRequiresCorrectCfAgainstFormFieldsAndFailsOnWrongLastName: This test verifies that the validation mechanism mandates a correct Codice Fiscale against the form fields and rejects submissions with an incorrect last name.

testValidationRequiresCorrectCfAgainstFormFieldsAndFailsOnWrongBirthDay: The purpose of this test is to confirm that the validation process demands a correct Codice Fiscale in relation to the form fields and rejects submissions with an incorrect birth day.

testValidationRequiresCorrectCfAgainstFormFieldsAndFailsOnWrongBirthMonth: This test ensures that the validation process necessitates a correct Codice Fiscale against the form fields and fails on submissions with an incorrect birth month.

testValidationRequiresCorrectCfAgainstFormFieldsAndFailsOnWrongBirthYear: Verifying that the validation process mandates a correct Codice Fiscale against the form fields and rejects submissions with an incorrect birth year is the focus of this test.

testValidationRequiresCorrectCfAgainstFormFieldsAndFailsOnWrongPlace: This test confirms that the validation process requires a correct Codice Fiscale against the form fields and fails when an incorrect place is provided.

testValidationRequiresCorrectCfAgainstFormFieldsAndFailsOnWrongGender: The purpose of this test is to ensure that the validation process demands a correct Codice Fiscale against the form fields and rejects submissions with an incorrect gender.

Each test case was executed in a controlled testing environment, and the overall impact of the changes on different areas of the code was thoroughly examined. The testing process aimed to validate the accuracy and robustness of the implemented changes.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

Checklist: