From 30c089553ba855eccc9b01b23cd29b90bc44973b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Mon, 31 Mar 2025 20:46:07 +0300 Subject: [PATCH 1/8] bumped damsel --- rebar.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.lock b/rebar.lock index b1520e5..00a289a 100644 --- a/rebar.lock +++ b/rebar.lock @@ -19,7 +19,7 @@ {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"81d1edce2043500e4581867da3f5f4c31e682f44"}}, + {ref,"ecf49770668a5985e0cb2989220318d205e14c37"}}, 0}, {<<"dmt_client">>, {git,"https://github.com/valitydev/dmt_client.git", From 4a088e901bfb88aa9ab237bfef749e8954ecbe78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Mon, 31 Mar 2025 20:48:33 +0300 Subject: [PATCH 2/8] fixed --- rebar.config | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rebar.config b/rebar.config index 780fc4d..9d32db7 100644 --- a/rebar.config +++ b/rebar.config @@ -69,12 +69,10 @@ % for introspection on production {recon, "2.5.2"}, {logger_logstash_formatter, - {git, "https://github.com/valitydev/logger_logstash_formatter.git", {ref, "08a66a6"}}}, - {iosetopts, {git, "https://github.com/valitydev/iosetopts.git", {ref, "edb445c"}}} + {git, "https://github.com/valitydev/logger_logstash_formatter.git", {ref, "08a66a6"}}} ]}, {relx, [ {release, {limiter, "1.0.0"}, [ - iosetopts, {recon, load}, {runtime_tools, load}, {tools, load}, From 35b9b4e488d18ed27738b9b0fa5d18d50d4a2c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Mon, 31 Mar 2025 21:47:02 +0300 Subject: [PATCH 3/8] bumped again --- rebar.config | 2 +- rebar.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rebar.config b/rebar.config index 9d32db7..1720277 100644 --- a/rebar.config +++ b/rebar.config @@ -28,7 +28,7 @@ {deps, [ {prometheus, "4.8.1"}, {prometheus_cowboy, "0.1.8"}, - {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "master"}}}, + {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "new_party_config"}}}, {limiter_proto, {git, "https://github.com/valitydev/limiter-proto.git", {branch, "master"}}}, {liminator_proto, {git, "https://github.com/valitydev/liminator-proto.git", {branch, "master"}}}, {xrates_proto, {git, "https://github.com/valitydev/xrates-proto.git", {branch, "master"}}}, diff --git a/rebar.lock b/rebar.lock index 00a289a..3c6fe96 100644 --- a/rebar.lock +++ b/rebar.lock @@ -19,7 +19,7 @@ {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"ecf49770668a5985e0cb2989220318d205e14c37"}}, + {ref,"819fdf4a89d075f678649d401a47079406bf5b3d"}}, 0}, {<<"dmt_client">>, {git,"https://github.com/valitydev/dmt_client.git", From 7acee2bb1b37b3262da6f78463dbf1cbbc728500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Mon, 31 Mar 2025 21:52:49 +0300 Subject: [PATCH 4/8] bumped compose --- compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose.yaml b/compose.yaml index 70feb7b..a5b5fd6 100644 --- a/compose.yaml +++ b/compose.yaml @@ -24,7 +24,7 @@ services: condition: service_healthy dominant: - image: ghcr.io/valitydev/dominant:sha-2150eea + image: ghcr.io/valitydev/dominant:sha-d675862-epic-party_here command: /opt/dominant/bin/dominant foreground depends_on: machinegun: From 2a5ede7368f459e45ea36f6fe6e3301e8fdbe8c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Mon, 12 May 2025 13:28:03 +0300 Subject: [PATCH 5/8] removed identity --- apps/limiter/src/lim_config_codec.erl | 4 ---- apps/limiter/src/lim_config_machine.erl | 23 +++++++++-------------- apps/limiter/src/lim_wthdproc_context.erl | 12 +----------- apps/limiter/test/lim_ct_helper.hrl | 8 +------- apps/limiter/test/lim_turnover_SUITE.erl | 11 +---------- compose.yaml | 2 +- rebar.config | 2 +- rebar.lock | 2 +- 8 files changed, 15 insertions(+), 49 deletions(-) diff --git a/apps/limiter/src/lim_config_codec.erl b/apps/limiter/src/lim_config_codec.erl index 911591b..76caa6f 100644 --- a/apps/limiter/src/lim_config_codec.erl +++ b/apps/limiter/src/lim_config_codec.erl @@ -129,8 +129,6 @@ marshal_scope_type(shop) -> {shop, #config_LimitScopeEmptyDetails{}}; marshal_scope_type(wallet) -> {wallet, #config_LimitScopeEmptyDetails{}}; -marshal_scope_type(identity) -> - {identity, #config_LimitScopeEmptyDetails{}}; marshal_scope_type(payment_tool) -> {payment_tool, #config_LimitScopeEmptyDetails{}}; marshal_scope_type(provider) -> @@ -346,8 +344,6 @@ unmarshal_scope_type({shop, _}) -> shop; unmarshal_scope_type({wallet, _}) -> wallet; -unmarshal_scope_type({identity, _}) -> - identity; unmarshal_scope_type({payment_tool, _}) -> payment_tool; unmarshal_scope_type({provider, _}) -> diff --git a/apps/limiter/src/lim_config_machine.erl b/apps/limiter/src/lim_config_machine.erl index 4884c68..cfac8c9 100644 --- a/apps/limiter/src/lim_config_machine.erl +++ b/apps/limiter/src/lim_config_machine.erl @@ -51,7 +51,6 @@ party | shop | wallet - | identity | payment_tool | provider | terminal @@ -675,7 +674,6 @@ enumerate_context_bits(Types) -> [ party, shop, - identity, wallet, payment_tool, provider, @@ -707,13 +705,13 @@ squash_scope_types([party, shop | Rest]) -> % NOTE % Shop scope implies party scope. [shop | squash_scope_types(Rest)]; -squash_scope_types([identity, wallet | Rest]) -> +squash_scope_types([party, wallet | Rest]) -> % NOTE - % Wallet scope implies identity scope. + % Wallet scope implies party scope. [wallet | squash_scope_types(Rest)]; squash_scope_types([provider, terminal | Rest]) -> % NOTE - % Provider scope implies identity scope. + % Provider scope implies provider scope. [terminal | squash_scope_types(Rest)]; squash_scope_types([Type | Rest]) -> [Type | squash_scope_types(Rest)]; @@ -729,10 +727,8 @@ get_context_bits(shop) -> [{from, owner_id}, {from, shop_id}]; get_context_bits(payment_tool) -> [{from, payment_tool}]; -get_context_bits(identity) -> - [{prefix, <<"identity">>}, {from, identity_id}]; get_context_bits(wallet) -> - [{prefix, <<"wallet">>}, {from, identity_id}, {from, wallet_id}]; + [{prefix, <<"wallet">>}, {from, owner_id}, {from, wallet_id}]; get_context_bits(provider) -> [{prefix, <<"provider">>}, {from, provider_id}]; get_context_bits(terminal) -> @@ -1066,9 +1062,9 @@ check_calculate_year_shard_id_test() -> } }). --define(WITHDRAWAL(OwnerID, IdentityID, PaymentTool), #wthd_domain_Withdrawal{ +-define(WITHDRAWAL(OwnerID, PaymentTool), #wthd_domain_Withdrawal{ destination = PaymentTool, - sender = #wthd_domain_Identity{id = IdentityID, owner_id = OwnerID}, + sender = OwnerID, created_at = <<"2000-02-02T12:12:12Z">>, body = #domain_Cash{amount = 42, currency = #domain_CurrencyRef{symbolic_code = <<"CNY">>}} }). @@ -1112,7 +1108,7 @@ prefix_content_test_() -> }, WithdrawalContext = #{ context => ?WITHDRAWAL_CTX( - ?WITHDRAWAL(<<"OWNER">>, <<"IDENTITY">>, ?PAYMENT_TOOL), + ?WITHDRAWAL(<<"OWNER">>, ?PAYMENT_TOOL), <<"WALLET">>, ?ROUTE(22, 2) ) @@ -1138,13 +1134,12 @@ prefix_content_test_() -> ), ?_assertEqual( {ok, - {<<"/OWNER/wallet/IDENTITY/WALLET">>, #{ - <<"Scope.identity_id">> => <<"IDENTITY">>, + {<<"/wallet/OWNER/WALLET">>, #{ <<"Scope.owner_id">> => <<"OWNER">>, <<"Scope.prefix">> => <<"wallet">>, <<"Scope.wallet_id">> => <<"WALLET">> }}}, - mk_scope_prefix_impl(ordsets:from_list([wallet, identity, party]), withdrawal_processing, WithdrawalContext) + mk_scope_prefix_impl(ordsets:from_list([wallet, party]), withdrawal_processing, WithdrawalContext) ), ?_assertEqual( {ok, diff --git a/apps/limiter/src/lim_wthdproc_context.erl b/apps/limiter/src/lim_wthdproc_context.erl index 595222f..f9aad8e 100644 --- a/apps/limiter/src/lim_wthdproc_context.erl +++ b/apps/limiter/src/lim_wthdproc_context.erl @@ -37,7 +37,6 @@ make_change_context( genlib_map:compact(#{ <<"Context.op">> => genlib:to_binary(Operation), <<"Context.owner_id">> => try_get_value(owner_id, Context, undefined), - <<"Context.identity_id">> => try_get_value(identity_id, Context, undefined), <<"Context.wallet_id">> => try_get_value(wallet_id, Context, undefined) })}. @@ -71,8 +70,6 @@ get_value(cost, Operation, Context) -> get_cost(Operation, Context); get_value(payment_tool, Operation, Context) -> get_payment_tool(Operation, Context); -get_value(identity_id, Operation, Context) -> - get_identity_id(Operation, Context); get_value(wallet_id, Operation, Context) -> get_wallet_id(Operation, Context); get_value(provider_id, Operation, Context) -> @@ -113,8 +110,7 @@ get_value(ValueName, _Operation, _Context) -> -define(SENDER_RECEIVER(V), ?AUTH_DATA({sender_receiver, V})). get_owner_id(?WITHDRAWAL(Wthd)) -> - Identity = Wthd#wthd_domain_Withdrawal.sender, - {ok, Identity#wthd_domain_Identity.owner_id}; + {ok, Wthd#wthd_domain_Withdrawal.sender}; get_owner_id(_CtxWithdrawal) -> {error, notfound}. @@ -135,12 +131,6 @@ get_payment_tool(withdrawal, ?WITHDRAWAL(Wthd)) -> get_payment_tool(_, _CtxWithdrawal) -> {error, notfound}. -get_identity_id(withdrawal, ?WITHDRAWAL(Wthd)) -> - Identity = Wthd#wthd_domain_Withdrawal.sender, - {ok, Identity#wthd_domain_Identity.id}; -get_identity_id(_, _CtxWithdrawal) -> - {error, notfound}. - get_wallet_id(withdrawal, ?WALLET_ID(WalletID)) -> {ok, WalletID}; get_wallet_id(_, _CtxWithdrawal) -> diff --git a/apps/limiter/test/lim_ct_helper.hrl b/apps/limiter/test/lim_ct_helper.hrl index d0e54b5..46a175e 100644 --- a/apps/limiter/test/lim_ct_helper.hrl +++ b/apps/limiter/test/lim_ct_helper.hrl @@ -38,7 +38,6 @@ -define(scope_provider(), {provider, #config_LimitScopeEmptyDetails{}}). -define(scope_terminal(), {terminal, #config_LimitScopeEmptyDetails{}}). -define(scope_payer_contact_email(), {payer_contact_email, #config_LimitScopeEmptyDetails{}}). --define(scope_identity(), {identity, #config_LimitScopeEmptyDetails{}}). -define(scope_wallet(), {wallet, #config_LimitScopeEmptyDetails{}}). -define(scope_sender(), {sender, #config_LimitScopeEmptyDetails{}}). -define(scope_receiver(), {receiver, #config_LimitScopeEmptyDetails{}}). @@ -231,11 +230,6 @@ %% Wthdproc --define(identity(OwnerID), #wthd_domain_Identity{ - id = OwnerID, - owner_id = OwnerID -}). - -define(auth_data(Sender, Receiver), {sender_receiver, #wthd_domain_SenderReceiverAuthData{sender = Sender, receiver = Receiver}} ). @@ -248,7 +242,7 @@ body = Body, created_at = ?timestamp, destination = Destination, - sender = ?identity(OwnerID), + sender = OwnerID, auth_data = AuthData }). diff --git a/apps/limiter/test/lim_turnover_SUITE.erl b/apps/limiter/test/lim_turnover_SUITE.erl index 27ac719..eaeeac4 100644 --- a/apps/limiter/test/lim_turnover_SUITE.erl +++ b/apps/limiter/test/lim_turnover_SUITE.erl @@ -54,7 +54,6 @@ -export([commit_with_terminal_scope_ok/1]). -export([commit_with_email_scope_ok/1]). --export([commit_with_identity_scope_ok/1]). -export([commit_with_wallet_scope_ok/1]). -export([commit_with_multi_scope_ok/1]). -export([hold_with_sender_notfound/1]). @@ -156,7 +155,6 @@ groups() -> commit_with_party_scope_ok, commit_with_provider_scope_ok, commit_with_terminal_scope_ok, - commit_with_identity_scope_ok, commit_with_wallet_scope_ok, commit_with_sender_scope_ok, commit_with_receiver_scope_ok, @@ -714,16 +712,9 @@ commit_with_email_scope_ok(C) -> {ok, {vector, _}} = hold_and_commit(?LIMIT_CHANGE(ID, ?CHANGE_ID, Version), Context, ?config(client, C)), {ok, #limiter_Limit{}} = lim_client:get(ID, Version, Context, ?config(client, C)). --spec commit_with_identity_scope_ok(config()) -> _. -commit_with_identity_scope_ok(C) -> - {ID, Version} = configure_limit(?time_range_month(), ?scope([?scope_identity()]), C), - Context = ?wthdproc_ctx_withdrawal(?cash(10, <<"RUB">>)), - {ok, {vector, _}} = hold_and_commit(?LIMIT_CHANGE(ID, ?CHANGE_ID, Version), Context, ?config(client, C)), - {ok, #limiter_Limit{}} = lim_client:get(ID, Version, Context, ?config(client, C)). - -spec commit_with_wallet_scope_ok(config()) -> _. commit_with_wallet_scope_ok(C) -> - {ID, Version} = configure_limit(?time_range_month(), ?scope([?scope_wallet()]), C), + {ID, Version} = configure_limit(?time_range_month(), ?scope([?scope_party(), ?scope_wallet()]), C), Context = ?wthdproc_ctx_withdrawal(?cash(10, <<"RUB">>)), {ok, {vector, _}} = hold_and_commit(?LIMIT_CHANGE(ID, ?CHANGE_ID, Version), Context, ?config(client, C)), {ok, #limiter_Limit{}} = lim_client:get(ID, Version, Context, ?config(client, C)). diff --git a/compose.yaml b/compose.yaml index a5b5fd6..8499dab 100644 --- a/compose.yaml +++ b/compose.yaml @@ -24,7 +24,7 @@ services: condition: service_healthy dominant: - image: ghcr.io/valitydev/dominant:sha-d675862-epic-party_here + image: ghcr.io/valitydev/dominant:sha-e936ed2-epic-party_here command: /opt/dominant/bin/dominant foreground depends_on: machinegun: diff --git a/rebar.config b/rebar.config index 1720277..31c8ccb 100644 --- a/rebar.config +++ b/rebar.config @@ -29,7 +29,7 @@ {prometheus, "4.8.1"}, {prometheus_cowboy, "0.1.8"}, {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "new_party_config"}}}, - {limiter_proto, {git, "https://github.com/valitydev/limiter-proto.git", {branch, "master"}}}, + {limiter_proto, {git, "https://github.com/valitydev/limiter-proto.git", {branch, "party_here"}}}, {liminator_proto, {git, "https://github.com/valitydev/liminator-proto.git", {branch, "master"}}}, {xrates_proto, {git, "https://github.com/valitydev/xrates-proto.git", {branch, "master"}}}, {machinery, {git, "https://github.com/valitydev/machinery-erlang.git", {tag, "v1.1.0"}}}, diff --git a/rebar.lock b/rebar.lock index 3c6fe96..53d1532 100644 --- a/rebar.lock +++ b/rebar.lock @@ -59,7 +59,7 @@ 0}, {<<"limiter_proto">>, {git,"https://github.com/valitydev/limiter-proto.git", - {ref,"efeb7d4a05bd13c95fada18514509b34b107fcb9"}}, + {ref,"022ff522f96c91dcf5d161b9cb60a5eb5129cd28"}}, 0}, {<<"machinery">>, {git,"https://github.com/valitydev/machinery-erlang.git", From 40861c66afd6c863980fc17e88dde5057c209974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Mon, 12 May 2025 13:50:36 +0300 Subject: [PATCH 6/8] bumped damsel --- rebar.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.lock b/rebar.lock index 53d1532..eb3c1c7 100644 --- a/rebar.lock +++ b/rebar.lock @@ -19,7 +19,7 @@ {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"819fdf4a89d075f678649d401a47079406bf5b3d"}}, + {ref,"c7a6176d584395f7b11c20ab2bcc98390f50cb0a"}}, 0}, {<<"dmt_client">>, {git,"https://github.com/valitydev/dmt_client.git", From dcc2046c978ba0a06001f78173b9a8b9b7d32f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Wed, 28 May 2025 12:00:41 +0300 Subject: [PATCH 7/8] bumped --- rebar.config | 4 ++-- rebar.lock | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rebar.config b/rebar.config index 31c8ccb..9d32db7 100644 --- a/rebar.config +++ b/rebar.config @@ -28,8 +28,8 @@ {deps, [ {prometheus, "4.8.1"}, {prometheus_cowboy, "0.1.8"}, - {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "new_party_config"}}}, - {limiter_proto, {git, "https://github.com/valitydev/limiter-proto.git", {branch, "party_here"}}}, + {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "master"}}}, + {limiter_proto, {git, "https://github.com/valitydev/limiter-proto.git", {branch, "master"}}}, {liminator_proto, {git, "https://github.com/valitydev/liminator-proto.git", {branch, "master"}}}, {xrates_proto, {git, "https://github.com/valitydev/xrates-proto.git", {branch, "master"}}}, {machinery, {git, "https://github.com/valitydev/machinery-erlang.git", {tag, "v1.1.0"}}}, diff --git a/rebar.lock b/rebar.lock index eb3c1c7..35c9390 100644 --- a/rebar.lock +++ b/rebar.lock @@ -19,7 +19,7 @@ {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"c7a6176d584395f7b11c20ab2bcc98390f50cb0a"}}, + {ref,"ab44b9db25a76a2c50545fd884e4cdf3d3e3b628"}}, 0}, {<<"dmt_client">>, {git,"https://github.com/valitydev/dmt_client.git", @@ -59,7 +59,7 @@ 0}, {<<"limiter_proto">>, {git,"https://github.com/valitydev/limiter-proto.git", - {ref,"022ff522f96c91dcf5d161b9cb60a5eb5129cd28"}}, + {ref,"d4cdf0f6328125996ee705c3da87461f99dde7f4"}}, 0}, {<<"machinery">>, {git,"https://github.com/valitydev/machinery-erlang.git", From 7d3aeebc7bafc026acda29902cb416e98e970330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D0=B5=D0=BC?= Date: Wed, 28 May 2025 12:31:18 +0300 Subject: [PATCH 8/8] bumped dmt --- compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose.yaml b/compose.yaml index 8499dab..ab48136 100644 --- a/compose.yaml +++ b/compose.yaml @@ -24,7 +24,7 @@ services: condition: service_healthy dominant: - image: ghcr.io/valitydev/dominant:sha-e936ed2-epic-party_here + image: ghcr.io/valitydev/dominant:sha-ef03371-epic-party_here command: /opt/dominant/bin/dominant foreground depends_on: machinegun: