TD-933: Adds support for deviation direction for amount randomization (#47)

This commit is contained in:
Aleksey Kashapov 2024-07-03 12:58:11 +03:00 committed by GitHub
parent 89759bfd18
commit 85b19cb5f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,7 @@ encode_amount_randomization_params(Opts) when is_map(Opts) ->
{randomization, #domain_RandomizationMutationParams{
deviation = maps:get(<<"deviation">>, Opts),
precision = maps:get(<<"precision">>, Opts, 2),
direction = binary_to_existing_atom(maps:get(<<"direction">>, Opts, <<"both">>)),
min_amount_condition = maps:get(<<"minAmountCondition">>, Opts, undefined),
max_amount_condition = maps:get(<<"maxAmountCondition">>, Opts, 2),
amount_multiplicity_condition = maps:get(<<"amountMultiplicityCondition">>, Opts, undefined)
@ -35,6 +36,7 @@ decode_amount_randomization_params(Mutations) when is_list(Mutations) ->
{randomization, #domain_RandomizationMutationParams{
deviation = Deviation,
precision = Precision,
direction = Direction,
min_amount_condition = MinAmountCondition,
max_amount_condition = MaxAmountCondition,
amount_multiplicity_condition = AmountMultiplicityCondition
@ -44,6 +46,7 @@ decode_amount_randomization_params(Mutations) when is_list(Mutations) ->
#{
<<"deviation">> => Deviation,
<<"precision">> => Precision,
<<"direction">> => atom_to_binary(Direction),
<<"minAmountCondition">> => MinAmountCondition,
<<"maxAmountCondition">> => MaxAmountCondition,
<<"amountMultiplicityCondition">> => AmountMultiplicityCondition

View File

@ -134,11 +134,11 @@
{<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.7">>},2},
{<<"swag_client">>,
{git,"https://github.com/valitydev/swag-payments",
{ref,"400015842b1a53a93dd1ea298914510a13a66f5d"}},
{ref,"078842bf8c25f7b962103943034544cc93d0459c"}},
0},
{<<"swag_server">>,
{git,"https://github.com/valitydev/swag-payments",
{ref,"79a46abf70bbf72394baa5dc14bafcc51d71fbd9"}},
{ref,"40e01d346c4902ec2ef5a66f11b88429cbcdcccd"}},
0},
{<<"thrift">>,
{git,"https://github.com/valitydev/thrift_erlang.git",