diff --git a/rebar.config b/rebar.config index 760541f..bd1fe96 100644 --- a/rebar.config +++ b/rebar.config @@ -31,8 +31,8 @@ {scoper, {git, "https://github.com/valitydev/scoper.git", {tag, "v1.1.0"}}}, {thrift, {git, "https://github.com/valitydev/thrift-erlang.git", {tag, "v1.0.0"}}}, {woody, {git, "https://github.com/valitydev/woody_erlang.git", {tag, "v1.1.0"}}}, - {dmt_client, {git, "https://github.com/valitydev/dmt-client.git", {tag, "v2.0.2"}}}, - {damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.11"}}}, + {dmt_client, {git, "https://github.com/valitydev/dmt-client.git", {tag, "v2.0.3"}}}, + {damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.12"}}}, {identdocstore_proto, {git, "https://github.com/valitydev/identdocstore-proto.git", {branch, "master"}}}, {fistful_proto, {git, "https://github.com/valitydev/fistful-proto.git", {tag, "v2.0.0"}}}, {fistful_reporter_proto, {git, "https://github.com/valitydev/fistful-reporter-proto.git", {branch, "master"}}}, diff --git a/rebar.lock b/rebar.lock index 254050b..0aadf7e 100644 --- a/rebar.lock +++ b/rebar.lock @@ -21,11 +21,11 @@ {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},2}, {<<"damsel">>, {git,"https://github.com/valitydev/damsel.git", - {ref,"ff9b01f552f922ce4a16710827aa872325dbe5a9"}}, + {ref,"8cab698cd78125ac47489d0ba81169df376757a4"}}, 0}, {<<"dmt_client">>, {git,"https://github.com/valitydev/dmt-client.git", - {ref,"fff521d3d50b48e3c6b628fe4796b3628aedc6b7"}}, + {ref,"20c18cc9b51d0f273db60c929e8a8a871d6a1866"}}, 0}, {<<"file_storage_proto">>, {git,"https://github.com/valitydev/file-storage-proto.git", diff --git a/src/wapi_wallet_backend.erl b/src/wapi_wallet_backend.erl index 047be2a..1865c27 100644 --- a/src/wapi_wallet_backend.erl +++ b/src/wapi_wallet_backend.erl @@ -14,7 +14,8 @@ get(WalletID, _HandlerContext) -> case get_wallet_config(WalletID) of {ok, WalletConfig} -> - {ok, unmarshal(wallet, {WalletID, WalletConfig}), WalletConfig#domain_WalletConfig.party_id}; + #domain_WalletConfig{party_ref = #domain_PartyConfigRef{id = PartyID}} = WalletConfig, + {ok, unmarshal(wallet, {WalletID, WalletConfig}), PartyID}; {error, notfound} -> {error, {wallet, notfound}} end. @@ -23,8 +24,8 @@ get(WalletID, _HandlerContext) -> get_account(WalletID, HandlerContext) -> DomainRevision = wapi_domain_backend:head(), case get_wallet_config(WalletID) of - {ok, #domain_WalletConfig{party_id = PartyID, account = #domain_WalletAccount{settlement = AccountID}}} -> - Request = {party_management, 'GetAccountState', {PartyID, AccountID, DomainRevision}}, + {ok, #domain_WalletConfig{party_ref = PartyRef, account = #domain_WalletAccount{settlement = AccountID}}} -> + Request = {party_management, 'GetAccountState', {PartyRef, AccountID, DomainRevision}}, case wapi_handler_utils:service_call(Request, HandlerContext) of {ok, AccountBalanceThrift} -> {ok, unmarshal(account_state, AccountBalanceThrift)}; @@ -51,14 +52,14 @@ unmarshal( name = Name, block = Blocking, account = #domain_WalletAccount{currency = #domain_CurrencyRef{symbolic_code = Currency}}, - party_id = PartyID + party_ref = PartyRef }} ) -> genlib_map:compact(#{ <<"id">> => unmarshal(id, WalletID), <<"name">> => unmarshal(string, Name), <<"isBlocked">> => unmarshal(blocking, Blocking), - <<"party">> => PartyID, + <<"party">> => PartyRef#domain_PartyConfigRef.id, <<"currency">> => Currency }); unmarshal(blocking, {unblocked, _}) -> diff --git a/test/wapi_ct_helper.erl b/test/wapi_ct_helper.erl index 4095eca..2da2e97 100644 --- a/test/wapi_ct_helper.erl +++ b/test/wapi_ct_helper.erl @@ -152,7 +152,7 @@ start_app({dmt_client = AppName, SupPid}) -> currency = #domain_CurrencyRef{symbolic_code = <<"RUB">>}, settlement = ?INTEGER }, - party_id = ?STRING + party_ref = #domain_PartyConfigRef{id = ?STRING} } }, PartyConfigObject = #domain_PartyConfigObject{ @@ -168,8 +168,6 @@ start_app({dmt_client = AppName, SupPid}) -> {active, #domain_Active{ since = wapi_time:rfc3339() }}, - shops = [], - wallets = [#domain_WalletConfigRef{id = ?STRING}], contact_info = #domain_PartyContactInfo{ registration_email = <<"test@test.ru">> }