Farfetch / rules-framework

A generic framework that allows defining and evaluating rules for complex business scenarios.
MIT License
41 stars 8 forks source link

Create non generic rules engine #169

Closed luispfgarces closed 1 month ago

luispfgarces commented 2 months ago

Description

Evolves the rules engine to a non-generic version by setting the content type and condition type to a string default. The library users can optionally use a generic rules engine wrapper specifying TContentType and TConditionType - as long as those types are either enum types or other types convertible to string and parseable from string.

[!WARNING] Breaking change on rules engine build-up. Current usages of the library will have to remove TContentType and TConditionType from builder methods and use and additional MakeGeneric<TContentType, TConditionType>() method to get a equivalent instance of RulesEngine<TContentType, TConditionType>.

[!WARNING] Additional APIs were added to create and get content types from the rules engine. From now on, the library users will be required to create explicitly the content types using the new API, except if the AutoCreateContentTypes option is true. This is a breaking change on behavior.

Change checklist

Please also check the I want to contribute guidelines and make sure you have done accordingly.

Disclaimer

By sending us your contributions, you are agreeing that your contribution is made subject to the terms of our Contributor Ownership Statement