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

Custom Rule Builder #4

Closed
3 tasks done
timokoenig opened this issue Feb 3, 2022 · 12 comments
Closed
3 tasks done

Custom Rule Builder #4

timokoenig opened this issue Feb 3, 2022 · 12 comments
Assignees
Labels
enhancement New feature or request

Comments

@timokoenig
Copy link
Owner

timokoenig commented Feb 3, 2022

Rules change so much nowadays that it is almost impossible to keep up with the regulations. Every state and sometimes even every city or company have their own rules. We can offer a rule builder where companies can create their own rule set that meet their need.

  • Create overview of current regulations
  • Implement rule build that allows to create custom rules
  • Save custom rules in local storage
@timokoenig timokoenig changed the title Implement a rule builder Custom Rule Builder Feb 3, 2022
@timokoenig timokoenig added the enhancement New feature or request label Feb 3, 2022
@timokoenig timokoenig self-assigned this Feb 11, 2022
@timokoenig
Copy link
Owner Author

I started a collection of current EU and local rules here

@timokoenig
Copy link
Owner Author

First version of the custom rule builder is done. I'm going to create local rules for Hamburg and then write a few tests to see how it works. If everything works as expected I will deploy the rule builder tonight or tomorrow

@timokoenig
Copy link
Owner Author

First look of the new rule builder, still a lot of UI work needs to be done though

Screen Shot 2022-02-14 at 18 18 20

@Ein-Tim
Copy link
Contributor

Ein-Tim commented Feb 14, 2022

@timokoenig I guess https://github.com/timokoenig/covid-validator/tree/rule-builder is the branch you are working on, right? Then I could test this feature locally.

@timokoenig
Copy link
Owner Author

@Ein-Tim that's correct but you won't be able to select those rules at the moment therefore a testing is kinda difficult. Will let you know when this is implemented

@Ein-Tim
Copy link
Contributor

Ein-Tim commented Feb 14, 2022

Okay thanks, I can also translate this into German/French again.

I'm trying to get French translation ready by the end of this week, but I'm so busy at the moment.

@timokoenig
Copy link
Owner Author

IMO translations for the rule builder is not necessary until its fully functional and tested

@Ein-Tim
Copy link
Contributor

Ein-Tim commented Feb 14, 2022

Yeah for sure, I meant after it is finished!

@timokoenig
Copy link
Owner Author

Update: I started creating several test cases and noticed and few problems. The "official" certlogic library doesn't support certain (very basic) operations. I created locally a clone that does everything we need but I will try to bring those changes in the official library. Until then I most likely publish my own certlogic package with these adjustments to continue with this feature

@timokoenig
Copy link
Owner Author

timokoenig commented Feb 15, 2022

Just tested successfully the local rules from Hamburg.

 PASS  tests/custom-rules.test.ts
  ✓ BioNTech; Partial Immunization; INVALID (2 ms)
  ✓ BioNTech; Full Immunization; VALID (1 ms)
  ✓ BioNTech; Full Immunization shortly after vaccination; INVALID (2 ms)
  ✓ BioNTech; Full Immunization in one year; INVALID (1 ms)
  ✓ BioNTech; Full Immunization after Recovery; VALID
  ✓ BioNTech; Full Immunization after Recovery shortly after vaccination; VALID (1 ms)
  ✓ BioNTech; Booster Immunization; VALID (1 ms)
  ✓ BioNTech; Booster Immunization shortly after vaccination; VALID (1 ms)
  ✓ BioNTech; Booster Immunization in one year; VALID
  ✓ BioNTech; Booster Immunization after Recovery; VALID
  ✓ J&J; Partial Immunization; INVALID (1 ms)
  ✓ J&J; Full Immunization; VALID (1 ms)
  ✓ J&J; Booster Immunization; VALID (1 ms)
  ✓ J&J; Booster Immunization after Recovery; VALID (1 ms)
  ✓ Special; Full Immunization with unregistered mp; INVALID (1 ms)
  ✓ Recovery after 10 days; INVALID
  ✓ Recovery after 30 days; VALID (1 ms)
  ✓ Antigen after 10 hours; VALID
  ✓ Antigen after 30 hours; INVALID (1 ms)
  ✓ PCR after 10 hours; VALID
  ✓ PCR after 80 hours; INVALID (1 ms)
  ✓ Unknown Test after 10 hours; INVALID (1 ms)

Next up:

  • Clean up the feature branch
  • Check the state rules for Germany
  • Create all state rules
  • Add documentation for rule builder and state rules
  • Deploy rule builder and state rules

@timokoenig
Copy link
Owner Author

BTW I found another solution to the missing operations of the certlogic-js module. Will use nested if-statements instead of an or-statement.

@timokoenig timokoenig mentioned this issue Feb 15, 2022
@timokoenig
Copy link
Owner Author

Just deployed the new version with the first version of the rule builder. Many more enhancements will be made but that will be tracked in separate tickets like #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants