ED-313: reading extra field revertStatus from request (#34)

* deposits: reading extra field revertStatus from request

* deposits: included revertStatus field to response

* small update

* upcased enums

* updated swag submodule
This commit is contained in:
yuri-bukhalenkov 2021-11-15 14:30:37 +03:00 committed by GitHub
parent de8fca96d2
commit 4fc6b01a7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 5 deletions

View File

@ -102,7 +102,8 @@ create_query(deposits, Req, Context) ->
<<"to_time">> => get_time(createdAtTo, Req),
<<"amount_from">> => genlib_map:get(amountFrom, Req),
<<"amount_to">> => genlib_map:get(amountTo, Req),
<<"currency_code">> => genlib_map:get(currencyID, Req)
<<"currency_code">> => genlib_map:get(currencyID, Req),
<<"revert_status">> => genlib_map:get(revertStatus, Req)
};
create_query(wallets, Req, Context) ->
#{
@ -235,7 +236,8 @@ unmarshal_response(deposits, Response) ->
<<"fee">> => unmarshal_cash(
Response#fistfulstat_StatDeposit.fee,
Response#fistfulstat_StatDeposit.currency_symbolic_code
)
),
<<"revertStatus">> => unmarshal_revert_status(Response#fistfulstat_StatDeposit.revert_status)
},
unmarshal_deposit_stat_status(Response#fistfulstat_StatDeposit.status)
);
@ -307,6 +309,15 @@ unmarshal_status({failed, _}) ->
<<"failure">> => #{<<"code">> => <<"failed">>}
}.
unmarshal_revert_status(undefined) ->
undefined;
unmarshal_revert_status(none) ->
<<"None"/utf8>>;
unmarshal_revert_status(partial) ->
<<"Partial"/utf8>>;
unmarshal_revert_status(full) ->
<<"Full"/utf8>>.
unmarshal_changes_plan(#fistfulstat_DepositAdjustmentChangesPlan{new_cash = Cash, new_status = Status}) ->
maps:merge(#{<<"cash">> => unmarshal_cash_change_plan(Cash)}, unmarshal_status_change_plan(Status)).

@ -1 +1 @@
Subproject commit be44d69fc87b22a0bb82d98d6eae7658d1647f98
Subproject commit a87ebf3ae5e56910dc6a0edcac7f90565368a3d1

View File

@ -59,7 +59,7 @@
0},
{<<"fistful_proto">>,
{git,"https://github.com/rbkmoney/fistful-proto.git",
{ref,"914c9986d45635f93569d896f515a0b3e93ea913"}},
{ref,"4724f88511f37a63d437524f86aa7221b74a8ea1"}},
0},
{<<"fistful_reporter_proto">>,
{git,"https://github.com/rbkmoney/fistful-reporter-proto.git",

@ -1 +1 @@
Subproject commit 854f19c72e3cafc0b757e9c7cdf154c87114332a
Subproject commit 256425d424dff6f5bf26bc028421f6c054b0e90d