Fix selector and condition patterns (#85)

This commit is contained in:
Andrew Mayorov 2017-05-11 22:52:50 +03:00 committed by GitHub
parent 5824c62847
commit ae2ec46239
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ test({currency_is, V1}, #{currency := V2}, _) ->
V1 =:= V2; V1 =:= V2;
test({cost_in, V}, #{cost := C}, _) -> test({cost_in, V}, #{cost := C}, _) ->
test_cash_range(C, V) =:= within; test_cash_range(C, V) =:= within;
test({payment_tool_condition, C}, #{payment_tool := V}, Rev) -> test({payment_tool, C}, #{payment_tool := V}, Rev) ->
hg_payment_tool:test_condition(C, V, Rev); hg_payment_tool:test_condition(C, V, Rev);
test({shop_location_is, V}, #{shop := S}, _) -> test({shop_location_is, V}, #{shop := S}, _) ->
V =:= S#domain_Shop.details#domain_ShopDetails.location; V =:= S#domain_Shop.details#domain_ShopDetails.location;

View File

@ -30,6 +30,6 @@ test_condition(_PaymentTool, _Condition, _Rev) ->
test_bank_card_condition({payment_system_is, Ps}, #domain_BankCard{payment_system = Ps0}, _Rev) -> test_bank_card_condition({payment_system_is, Ps}, #domain_BankCard{payment_system = Ps0}, _Rev) ->
Ps =:= Ps0; Ps =:= Ps0;
test_bank_card_condition({bank_card_bin_in, RangeRef}, #domain_BankCard{bin = BIN}, Rev) -> test_bank_card_condition({bin_in, RangeRef}, #domain_BankCard{bin = BIN}, Rev) ->
#domain_BankCardBINRange{bins = BINs} = hg_domain:get(Rev, {bank_card_bin_range, RangeRef}), #domain_BankCardBINRange{bins = BINs} = hg_domain:get(Rev, {bank_card_bin_range, RangeRef}),
ordsets:is_element(BIN, BINs). ordsets:is_element(BIN, BINs).