Farfetch / rules-framework

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

[Feature Request]: Arrays New Operators NotIn InMemory and MongoDB #112

Closed carlosgoias closed 1 year ago

carlosgoias commented 1 year ago

Is your request related to a problem you have?

Yes, I am not able to create rules with NotIn operators for arrays

Describe the solution you'd like

Able to create rules with NotIn operators for arrays

this.Add(
    this.Add(
        RuleBuilder
            .NewRule<RuleContentType, ConditionType>()
            .WithName("Some Rule")
            .WithContent(
                RuleContentType.SomeContentType,
                  "SomeText"
            )
            .WithCondition(x => x
                .AsValued(ConditionType.SomeConditionType).OfDataType<string>()
                .WithComparisonOperator(Operators.NotIn)
                .SetOperand(new[] { "11111", "22222", "33333", "44444", "55555" })
                .Build()
            )
            .WithDateBegin(DateTime.Parse("2022-01-01"))
            .Build(),
        RuleAddPriorityOption.ByPriorityNumber(1)
    );

Are you able to help bring it to life and contribute with a Pull Request?

Yes

Additional context

No response