Fix: Reduce combination (any_of, all_of) was not an ordset (#26)

* fixed

* updated workflow version
This commit is contained in:
Артем 2022-11-29 19:07:49 +04:00 committed by GitHub
parent 1e9f4fd840
commit bc8368d620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 3 deletions

View File

@ -30,7 +30,7 @@ jobs:
run: run:
name: Run checks name: Run checks
needs: setup needs: setup
uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v1.0.9 uses: valitydev/erlang-workflows/.github/workflows/erlang-parallel-build.yml@v1.0.10
with: with:
otp-version: ${{ needs.setup.outputs.otp-version }} otp-version: ${{ needs.setup.outputs.otp-version }}
rebar-version: ${{ needs.setup.outputs.rebar-version }} rebar-version: ${{ needs.setup.outputs.rebar-version }}

View File

@ -147,7 +147,7 @@ reduce_combination(_, Fix, [], _, _, []) ->
reduce_combination(_, _, [], _, _, [P]) -> reduce_combination(_, _, [], _, _, [P]) ->
P; P;
reduce_combination(Type, _, [], _, _, PAcc) -> reduce_combination(Type, _, [], _, _, PAcc) ->
{Type, lists:reverse(PAcc)}. {Type, ordsets:from_list(lists:reverse(PAcc))}.
reduce_condition(C, VS, Rev) -> reduce_condition(C, VS, Rev) ->
case pm_condition:test(C, VS, Rev) of case pm_condition:test(C, VS, Rev) of

View File

@ -2397,7 +2397,33 @@ construct_domain_fixture() ->
cash_limit = cash_limit =
{decisions, [ {decisions, [
#domain_CashLimitDecision{ #domain_CashLimitDecision{
if_ = {condition, {currency_is, ?cur(<<"RUB">>)}}, if_ =
{any_of,
ordsets:from_list([
{any_of,
ordsets:from_list([
{condition, {currency_is, ?cur(<<"RUB">>)}},
{condition,
{payment_tool,
{bank_card, #domain_BankCardCondition{
definition =
{payment_system, #domain_PaymentSystemCondition{
payment_system_is = #domain_PaymentSystemRef{
id = <<"visa">>
}
}}
}}}}
])},
{all_of,
ordsets:from_list([
{condition,
{cost_in,
?cashrng(
{inclusive, ?cash(424242, <<"USD">>)},
{inclusive, ?cash(424242, <<"USD">>)}
)}}
])}
])},
then_ = then_ =
{value, {value,
?cashrng( ?cashrng(