Skip to content

Update isValidCns logic to include CNS starting with 5 #59

@marianaflima

Description

@marianaflima

I need to update isValidCns() function on src/Helpers/Validate.php

Currently, the function validate_cns_tmp() only triggers for CNS numbers starting in 7, 8, or 9. Based on this documentation, numbers starting with 5 are now also valid and should follow the same validation logic.

I want you to locate where the conditional responsible for checking this out and add 5 to allowed digits.

To assure implementation is correct, I want you to generate/update test suites with the following examples:
Valid ones:

  • 550354737380003
  • 521473152170018
    Invalid ones:
  • 503521996570006
  • 556492895730003
  • 584480646290007

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions