Skip to content

Update isValidCns logic to include CNS starting with 5 #59

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions