From 24f9f6bd634534a9833c3fe6698cfc5e3df4c44d Mon Sep 17 00:00:00 2001 From: Aleksey Kashapov Date: Wed, 4 Sep 2024 18:30:42 +0300 Subject: [PATCH] IMP-278: Reverts damsel w/ legacy payouts supports (#143) * IMP-278: Reverts damsel w/ legacy payouts supports * Bumps damsel * Bumps damsel --- apps/hellgate/test/hg_ct_helper.erl | 30 ++++++++++++++++++++++++++--- compose.yaml | 2 +- rebar.lock | 2 +- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/apps/hellgate/test/hg_ct_helper.erl b/apps/hellgate/test/hg_ct_helper.erl index d3d6ee6..7e01722 100644 --- a/apps/hellgate/test/hg_ct_helper.erl +++ b/apps/hellgate/test/hg_ct_helper.erl @@ -425,11 +425,13 @@ create_shop_( ) -> ShopID = hg_utils:unique_id(), ContractID = hg_utils:unique_id(), + PayoutToolID = hg_utils:unique_id(), - ShopParams = make_shop_params(Category, ContractID), + ShopParams = make_shop_params(Category, ContractID, PayoutToolID), ShopAccountParams = #payproc_ShopAccountParams{currency = ?cur(Currency)}, ContractParams = make_contract_params(TemplateRef, PaymentInstRef), + PayoutToolParams = make_payout_tool_params(), TurnoverLimits1 = genlib:define(TurnoverLimits0, ordsets:new()), @@ -438,6 +440,14 @@ create_shop_( id = ContractID, modification = {creation, ContractParams} }}, + {contract_modification, #payproc_ContractModificationUnit{ + id = ContractID, + modification = + {payout_tool_modification, #payproc_PayoutToolModificationUnit{ + payout_tool_id = PayoutToolID, + modification = {creation, PayoutToolParams} + }} + }}, ?shop_modification(ShopID, {creation, ShopParams}), ?shop_modification(ShopID, {shop_account_creation, ShopAccountParams}), ?shop_modification(ShopID, {turnover_limits_modification, TurnoverLimits1}) @@ -460,12 +470,13 @@ create_party_and_shop(PartyID, Category, Currency, TemplateRef, PaymentInstRef, _ = create_party(PartyID, Client), create_shop(PartyID, Category, Currency, TemplateRef, PaymentInstRef, Client). -make_shop_params(Category, ContractID) -> +make_shop_params(Category, ContractID, PayoutToolID) -> #payproc_ShopParams{ category = Category, location = {url, <<>>}, details = #domain_ShopDetails{name = <<"Battle Ready Shop">>}, - contract_id = ContractID + contract_id = ContractID, + payout_tool_id = PayoutToolID }. make_party_params() -> @@ -548,6 +559,19 @@ make_contractor() -> russian_bank_account = BankAccount }}}. +-spec make_payout_tool_params() -> dmsl_payproc_thrift:'PayoutToolParams'(). +make_payout_tool_params() -> + #payproc_PayoutToolParams{ + currency = ?cur(<<"RUB">>), + tool_info = + {russian_bank_account, #domain_RussianBankAccount{ + account = <<"4276300010908312893">>, + bank_name = <<"SomeBank">>, + bank_post_account = <<"123129876">>, + bank_bik = <<"66642666">> + }} + }. + -spec make_invoice_params(party_id(), shop_id(), binary(), cash()) -> invoice_params(). make_invoice_params(PartyID, ShopID, Product, Cost) -> make_invoice_params(PartyID, ShopID, Product, make_due_date(), Cost). diff --git a/compose.yaml b/compose.yaml index e30e77d..2f6be76 100644 --- a/compose.yaml +++ b/compose.yaml @@ -97,7 +97,7 @@ services: disable: true party-management: - image: ghcr.io/valitydev/party-management:sha-e16301b + image: ghcr.io/valitydev/party-management:sha-9af7d71 command: /opt/party-management/bin/party-management foreground depends_on: machinegun: diff --git a/rebar.lock b/rebar.lock index 644037a..82a23b1 100644 --- a/rebar.lock +++ b/rebar.lock @@ -21,7 +21,7 @@ {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"8e034bc74b1f4ed0e00dd63d0c3ca9c922be1c47"}}, + {ref,"9d4aa513fcbc1cc7ba5eedd9f96d8bc8590a6ac2"}}, 0}, {<<"dmt_client">>, {git,"https://github.com/valitydev/dmt-client.git",