Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidationUtils: add validateLisencePlate function #39

Open
tsevdos opened this issue Feb 11, 2024 · 1 comment
Open

ValidationUtils: add validateLisencePlate function #39

tsevdos opened this issue Feb 11, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@tsevdos
Copy link
Owner

tsevdos commented Feb 11, 2024

Add validateLisencePlate function to validationUtils.ts module.

@tsevdos tsevdos converted this from a draft issue Feb 11, 2024
@tsevdos tsevdos added the good first issue Good for newcomers label Feb 11, 2024
@raptisj
Copy link
Contributor

raptisj commented Feb 25, 2024

I was thinking about normalizing all the license plate data in an object of its own so we can avoid the filtering upon filtering in all administrative regions which can cause performance issues. We could add other data as well that might be leveraged in future utils(e.g. returning the region/unit if a license plate is valid).

Normalized data could look something like this. The pattern field will have the same values as carPlatesPattern array.

{
  "PM": {
    "key": "PM",
    "pattern": "PM*",
    "region": 1,
    "unitId": 1
  },
  "TO": {
    "key": "TO",
    "pattern": "TO*",
    "regionId": 1,
    "unitId": 1
  },
  "EB": { 
    "key": "EB",
    "pattern": "EB*",
    "regionId": 1,
    "unitId": 2
  }
}

We can transfer this to a discussion for further details about specific implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Development

No branches or pull requests

2 participants