mirror of
https://github.com/valitydev/fistful-server.git
synced 2024-11-06 02:35:18 +00:00
TD-287: Remove userinfo and update protocols (#27)
This commit is contained in:
parent
d5fba5d8b5
commit
0d0c59a0c2
@ -198,22 +198,16 @@ create_identity(Party, Name, ProviderID, _C) ->
|
||||
),
|
||||
ID.
|
||||
|
||||
construct_userinfo() ->
|
||||
#payproc_UserInfo{id = <<"fistful">>, type = construct_usertype()}.
|
||||
|
||||
construct_usertype() ->
|
||||
{service_user, #payproc_ServiceUser{}}.
|
||||
|
||||
suspend_party(Party, C) ->
|
||||
Service = {dmsl_payment_processing_thrift, 'PartyManagement'},
|
||||
Args = {construct_userinfo(), Party},
|
||||
Args = {Party},
|
||||
Request = {Service, 'Suspend', Args},
|
||||
_ = ff_woody_client:call(partymgmt, Request, ct_helper:get_woody_ctx(C)),
|
||||
ok.
|
||||
|
||||
block_party(Party, C) ->
|
||||
Service = {dmsl_payment_processing_thrift, 'PartyManagement'},
|
||||
Args = {construct_userinfo(), Party, <<"BECAUSE">>},
|
||||
Args = {Party, <<"BECAUSE">>},
|
||||
Request = {Service, 'Block', Args},
|
||||
_ = ff_woody_client:call(partymgmt, Request, ct_helper:get_woody_ctx(C)),
|
||||
ok.
|
||||
|
@ -35,6 +35,8 @@
|
||||
-type payinst() :: dmsl_domain_thrift:'PaymentInstitution'().
|
||||
-type payinst_ref() :: dmsl_domain_thrift:'PaymentInstitutionRef'().
|
||||
|
||||
-type residence_id() :: dmsl_domain_thrift:'Residence'().
|
||||
|
||||
-export_type([id/0]).
|
||||
-export_type([provider/0]).
|
||||
|
||||
@ -56,7 +58,7 @@
|
||||
|
||||
-spec id(provider()) -> id().
|
||||
-spec name(provider()) -> binary().
|
||||
-spec residences(provider()) -> [ff_residence:id()].
|
||||
-spec residences(provider()) -> [residence_id()].
|
||||
-spec payinst(provider()) -> payinst_ref().
|
||||
-spec contract_template(provider()) -> contract_template_ref().
|
||||
-spec contractor_level(provider()) -> contractor_level().
|
||||
|
@ -1,34 +0,0 @@
|
||||
%%%
|
||||
%%% Residence
|
||||
%%%
|
||||
%%% TODOs:
|
||||
%%% - Move it to some kind of domain config
|
||||
%%%
|
||||
|
||||
-module(ff_residence).
|
||||
|
||||
%%
|
||||
|
||||
-type id() :: dmsl_domain_thrift:'Residence'().
|
||||
-type residence() :: #{
|
||||
id := id(),
|
||||
name := binary(),
|
||||
flag => binary()
|
||||
}.
|
||||
|
||||
-export_type([id/0]).
|
||||
-export_type([residence/0]).
|
||||
|
||||
-export([get/1]).
|
||||
|
||||
%%
|
||||
|
||||
-spec get(id()) -> ff_map:result(residence()).
|
||||
get(ID = 'rus') ->
|
||||
{ok, #{
|
||||
id => ID,
|
||||
name => <<"Российская федерация"/utf8>>,
|
||||
flag => <<"🇷🇺"/utf8>>
|
||||
}};
|
||||
get(_) ->
|
||||
{error, notfound}.
|
@ -197,22 +197,16 @@ construct_wallet_params(IdentityID, Currency) ->
|
||||
currency => Currency
|
||||
}.
|
||||
|
||||
construct_userinfo() ->
|
||||
#payproc_UserInfo{id = <<"fistful">>, type = construct_usertype()}.
|
||||
|
||||
construct_usertype() ->
|
||||
{service_user, #payproc_ServiceUser{}}.
|
||||
|
||||
suspend_party(Party, C) ->
|
||||
Service = {dmsl_payment_processing_thrift, 'PartyManagement'},
|
||||
Args = {construct_userinfo(), Party},
|
||||
Args = {Party},
|
||||
Request = {Service, 'Suspend', Args},
|
||||
_ = ff_woody_client:call(partymgmt, Request, ct_helper:get_woody_ctx(C)),
|
||||
ok.
|
||||
|
||||
block_party(Party, C) ->
|
||||
Service = {dmsl_payment_processing_thrift, 'PartyManagement'},
|
||||
Args = {construct_userinfo(), Party, <<"BECAUSE">>},
|
||||
Args = {Party, <<"BECAUSE">>},
|
||||
Request = {Service, 'Block', Args},
|
||||
_ = ff_woody_client:call(partymgmt, Request, ct_helper:get_woody_ctx(C)),
|
||||
ok.
|
||||
|
@ -69,7 +69,7 @@ services:
|
||||
retries: 20
|
||||
|
||||
party-management:
|
||||
image: ghcr.io/valitydev/party-management:sha-f757b79
|
||||
image: ghcr.io/valitydev/party-management:sha-3353490
|
||||
command: /opt/party-management/bin/party-management foreground
|
||||
depends_on:
|
||||
machinegun:
|
||||
|
@ -14,7 +14,7 @@
|
||||
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},2},
|
||||
{<<"damsel">>,
|
||||
{git,"https://github.com/valitydev/damsel.git",
|
||||
{ref,"df1c52f2ebe175fabe1da4aec8ac889b2dd03a0b"}},
|
||||
{ref,"d384c125d16c0204e23b0d96a6ef791244a72315"}},
|
||||
0},
|
||||
{<<"dmt_client">>,
|
||||
{git,"https://github.com/valitydev/dmt_client.git",
|
||||
@ -53,7 +53,7 @@
|
||||
{<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.3.1">>},2},
|
||||
{<<"party_client">>,
|
||||
{git,"https://github.com/valitydev/party-client-erlang.git",
|
||||
{ref,"31850a63f6c00da7e10897b23298ad38f9bf448d"}},
|
||||
{ref,"4097004f78a526b7fe748719045dd428c905c2f0"}},
|
||||
0},
|
||||
{<<"prometheus">>,{pkg,<<"prometheus">>,<<"4.8.1">>},0},
|
||||
{<<"prometheus_cowboy">>,{pkg,<<"prometheus_cowboy">>,<<"0.1.8">>},0},
|
||||
|
Loading…
Reference in New Issue
Block a user