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

feat: Add full validation rules and vehicle types for TROS/TROW #1449

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

john-fletcher-aot
Copy link
Collaborator

@john-fletcher-aot john-fletcher-aot commented Jun 27, 2024

Description

Add a master configuration to represent the complete, current policy config for all permit types. Add all vehicle types and all validation rules for TROS and TROW to this master config.

Fixes # ORV2-2219, ORV2-2220

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Added unit tests for validation of a valid TROS and a valid TROW against the master config

Checklist

  • I have read the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have already been accepted and merged

Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are promoted to:

@zgong-gov
Copy link
Collaborator

How should I make use of this policy engine and its validations on the frontend? Does it generate a config json or something?

Copy link

sonarcloud bot commented Jun 27, 2024

@john-fletcher-aot
Copy link
Collaborator Author

How should I make use of this policy engine and its validations on the frontend? Does it generate a config json or something?

I will be writing up usage docs in the README shortly, though we haven't yet determined how we will share the package between fe and be. My ideal scenario is that you would npm install orbc-policy-engine, then you'll have the library available to use. Construct a new PolicyEngine by passing in a policy configuration, then using that PolicyEngine instance call a validate() method passing in the permit application JSON. Return type of the validate method (async) will be a ValidationResults object with arrays of individual results which could represent field data violations, invalid duration, invalid vehicle type for the permit type, etc.

But, this will be more clear in the README once I get it in there!

@john-fletcher-aot john-fletcher-aot merged commit 61b0559 into main Jun 27, 2024
18 checks passed
@john-fletcher-aot john-fletcher-aot deleted the ORV2-2219 branch June 27, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants