From d4b837458f911a6ba18a2f0c383bad8d3aad70be Mon Sep 17 00:00:00 2001 From: ttt161 Date: Thu, 25 Jun 2026 17:48:37 +0300 Subject: [PATCH 1/2] add allow_exchange flag --- apps/party_management/src/pm_provider.erl | 13 +++++++++---- apps/party_management/test/pm_party_tests_SUITE.erl | 6 ++++-- compose.yaml | 2 +- rebar.config | 3 ++- rebar.lock | 2 +- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/apps/party_management/src/pm_provider.erl b/apps/party_management/src/pm_provider.erl index 3af4337..a11730f 100644 --- a/apps/party_management/src/pm_provider.erl +++ b/apps/party_management/src/pm_provider.erl @@ -91,7 +91,9 @@ reduce_payment_terms(PaymentTerms, VS, DomainRevision) -> ), risk_coverage = reduce_if_defined(PaymentTerms#domain_PaymentsProvisionTerms.risk_coverage, VS, DomainRevision), turnover_limits = - reduce_if_defined(PaymentTerms#domain_PaymentsProvisionTerms.turnover_limits, VS, DomainRevision) + reduce_if_defined(PaymentTerms#domain_PaymentsProvisionTerms.turnover_limits, VS, DomainRevision), + allow_exchange = + reduce_predicate_if_defined(PaymentTerms#domain_PaymentsProvisionTerms.allow_exchange, VS, DomainRevision) }. reduce_payment_hold_terms(PaymentHoldTerms, VS, DomainRevision) -> @@ -206,7 +208,8 @@ merge_payment_terms( refunds = PRefunds, chargebacks = PChargebacks, risk_coverage = PRiskCoverage, - turnover_limits = PTurnoverLimits + turnover_limits = PTurnoverLimits, + allow_exchange = PAllowExchange }, #domain_PaymentsProvisionTerms{ allow = TAllow, @@ -220,7 +223,8 @@ merge_payment_terms( refunds = TRefunds, chargebacks = TChargebacks, risk_coverage = TRiskCoverage, - turnover_limits = TTurnoverLimits + turnover_limits = TTurnoverLimits, + allow_exchange = TAllowExchange } ) -> #domain_PaymentsProvisionTerms{ @@ -235,7 +239,8 @@ merge_payment_terms( refunds = pm_utils:select_defined(TRefunds, PRefunds), chargebacks = pm_utils:select_defined(TChargebacks, PChargebacks), risk_coverage = pm_utils:select_defined(TRiskCoverage, PRiskCoverage), - turnover_limits = pm_utils:select_defined(TTurnoverLimits, PTurnoverLimits) + turnover_limits = pm_utils:select_defined(TTurnoverLimits, PTurnoverLimits), + allow_exchange = pm_utils:select_defined(TAllowExchange, PAllowExchange) }; merge_payment_terms(ProviderTerms, TerminalTerms) -> pm_utils:select_defined(TerminalTerms, ProviderTerms). diff --git a/apps/party_management/test/pm_party_tests_SUITE.erl b/apps/party_management/test/pm_party_tests_SUITE.erl index 3686577..d177920 100644 --- a/apps/party_management/test/pm_party_tests_SUITE.erl +++ b/apps/party_management/test/pm_party_tests_SUITE.erl @@ -409,7 +409,8 @@ compute_provider_terminal_terms_ok(C) -> upper_boundary = 5000000, domain_revision = _ } - ]} + ]}, + allow_exchange = {constant, true} }, recurrent_paytools = #domain_RecurrentPaytoolsProvisionTerms{ cash_value = {value, ?cash(1000, <<"RUB">>)} @@ -1402,7 +1403,8 @@ construct_domain_fixture(PartyRef, PrevRev) -> {value, ?ordset([ ?pmt(bank_card, ?bank_card(<<"visa">>)) - ])} + ])}, + allow_exchange = {constant, true} } } } diff --git a/compose.yaml b/compose.yaml index 69e5db6..5d0ec1a 100644 --- a/compose.yaml +++ b/compose.yaml @@ -21,7 +21,7 @@ services: command: /sbin/init dmt: - image: ghcr.io/valitydev/dominant-v2:sha-c9430b5 + image: ghcr.io/valitydev/dominant-v2:sha-51fb871-epic-XYZ-19-currency-exchange-support command: /opt/dmt/bin/dmt foreground healthcheck: test: "/opt/dmt/bin/dmt ping" diff --git a/rebar.config b/rebar.config index 88f01e8..a3a108b 100644 --- a/rebar.config +++ b/rebar.config @@ -33,7 +33,8 @@ {prometheus, "4.11.0"}, {prometheus_cowboy, "0.1.9"}, {woody, {git, "https://github.com/valitydev/woody_erlang.git", {tag, "v1.1.0"}}}, - {damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.33"}}}, + %{damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.33"}}}, + {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "XYZ-19/ft/multi-currency"}}}, {payproc_errors, {git, "https://github.com/valitydev/payproc-errors-erlang.git", {branch, "master"}}}, {dmt_client, {git, "https://github.com/valitydev/dmt_client.git", {tag, "v2.0.3"}}}, {scoper, {git, "https://github.com/valitydev/scoper.git", {tag, "v1.1.0"}}}, diff --git a/rebar.lock b/rebar.lock index 300bb64..89be659 100644 --- a/rebar.lock +++ b/rebar.lock @@ -13,7 +13,7 @@ {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"e7a302a684deba1bb18a00d1056879329219d280"}}, + {ref,"389e46e908c21486d06bf5eea50bcd4b60b8cd45"}}, 0}, {<<"dmt_client">>, {git,"https://github.com/valitydev/dmt_client.git", From c2be4436fec843ffb1a9f603fa1a4f7c68ca8c32 Mon Sep 17 00:00:00 2001 From: ttt161 Date: Mon, 29 Jun 2026 11:15:12 +0300 Subject: [PATCH 2/2] cleanup --- compose.yaml | 2 +- rebar.config | 3 +-- rebar.lock | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compose.yaml b/compose.yaml index 5d0ec1a..737f93d 100644 --- a/compose.yaml +++ b/compose.yaml @@ -21,7 +21,7 @@ services: command: /sbin/init dmt: - image: ghcr.io/valitydev/dominant-v2:sha-51fb871-epic-XYZ-19-currency-exchange-support + image: ghcr.io/valitydev/dominant-v2:sha-ab393d5 command: /opt/dmt/bin/dmt foreground healthcheck: test: "/opt/dmt/bin/dmt ping" diff --git a/rebar.config b/rebar.config index a3a108b..03a9941 100644 --- a/rebar.config +++ b/rebar.config @@ -33,8 +33,7 @@ {prometheus, "4.11.0"}, {prometheus_cowboy, "0.1.9"}, {woody, {git, "https://github.com/valitydev/woody_erlang.git", {tag, "v1.1.0"}}}, - %{damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.33"}}}, - {damsel, {git, "https://github.com/valitydev/damsel.git", {branch, "XYZ-19/ft/multi-currency"}}}, + {damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.38"}}}, {payproc_errors, {git, "https://github.com/valitydev/payproc-errors-erlang.git", {branch, "master"}}}, {dmt_client, {git, "https://github.com/valitydev/dmt_client.git", {tag, "v2.0.3"}}}, {scoper, {git, "https://github.com/valitydev/scoper.git", {tag, "v1.1.0"}}}, diff --git a/rebar.lock b/rebar.lock index 89be659..50628f9 100644 --- a/rebar.lock +++ b/rebar.lock @@ -13,7 +13,7 @@ {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"389e46e908c21486d06bf5eea50bcd4b60b8cd45"}}, + {ref,"c529750144dea43ada113436762ee1e340f5503d"}}, 0}, {<<"dmt_client">>, {git,"https://github.com/valitydev/dmt_client.git",