Skip to content

Commit

Permalink
ED-186/removed eventsink (#580)
Browse files Browse the repository at this point in the history
* removed eventsink

* removed pm_event_provider

* removed hg_event_provider
  • Loading branch information
yuri-bukhalenkov authored Jun 25, 2021
1 parent 6f6be75 commit a30d183
Show file tree
Hide file tree
Showing 19 changed files with 3 additions and 729 deletions.
3 changes: 1 addition & 2 deletions apps/hellgate/src/hellgate.erl
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ get_api_child_spec(MachineHandlers, PMMachineHandlers, Opts) ->
construct_service_handler(customer_management, hg_customer, Opts),
construct_service_handler(recurrent_paytool, hg_recurrent_paytool, Opts),
construct_service_handler(recurrent_paytool_eventsink, hg_recurrent_paytool, Opts),
construct_service_handler(proxy_host_provider, hg_proxy_host_provider, Opts),
construct_service_handler(payment_processing_eventsink, hg_event_sink_handler, Opts)
construct_service_handler(proxy_host_provider, hg_proxy_host_provider, Opts)
],
additional_routes => [PrometeusRoute | HealthRoutes],
shutdown_timeout => genlib_app:env(?MODULE, shutdown_timeout, 0)
Expand Down
14 changes: 0 additions & 14 deletions apps/hellgate/src/hg_customer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
-export([process_call/2]).
-export([process_repair/2]).

%% Event provider callbacks

-behaviour(hg_event_provider).

-export([publish_event/2]).

%% Types

-define(SYNC_INTERVAL, 5).
Expand Down Expand Up @@ -178,14 +172,6 @@ map_start_error({ok, _}) ->
map_start_error({error, Reason}) ->
error(Reason).

%%
%% Event provider callbacks
%%

-spec publish_event(customer_id(), hg_machine:event_payload()) -> hg_event_provider:public_event().
publish_event(CustomerID, Payload) ->
{{customer_id, CustomerID}, ?customer_event(unmarshal_event_payload(Payload))}.

%%
%% hg_machine callbacks
%%
Expand Down
61 changes: 0 additions & 61 deletions apps/hellgate/src/hg_event_provider.erl

This file was deleted.

39 changes: 0 additions & 39 deletions apps/hellgate/src/hg_event_sink_handler.erl

This file was deleted.

11 changes: 0 additions & 11 deletions apps/hellgate/src/hg_invoice.erl
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
-export([process_call/2]).
-export([process_repair/2]).

%% Event provider callbacks

-behaviour(hg_event_provider).

-export([publish_event/2]).

%% Internal

-export([fail/1]).
Expand Down Expand Up @@ -450,7 +444,6 @@ map_history_error({error, notfound}) ->

-type invoice() :: dmsl_domain_thrift:'Invoice'().
-type party() :: dmsl_domain_thrift:'Party'().
-type invoice_id() :: dmsl_domain_thrift:'InvoiceID'().
-type invoice_tpl_id() :: dmsl_domain_thrift:'InvoiceTemplateID'().
-type invoice_params() :: dmsl_payment_processing_thrift:'InvoiceParams'().

Expand All @@ -467,10 +460,6 @@ map_history_error({error, notfound}) ->
}}
}).

-spec publish_event(invoice_id(), hg_machine:event_payload()) -> hg_event_provider:public_event().
publish_event(InvoiceID, Payload) ->
{{invoice_id, InvoiceID}, ?invoice_ev(unmarshal_event_payload(Payload))}.

%%

-spec namespace() -> hg_machine:ns().
Expand Down
12 changes: 0 additions & 12 deletions apps/hellgate/src/hg_invoice_template.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
-export([process_call/2]).
-export([process_repair/2]).

%% Event provider callbacks

-behaviour(hg_event_provider).

-export([publish_event/2]).

%% API

-export([get/1]).
Expand Down Expand Up @@ -318,12 +312,6 @@ update_field({details, V}, Tpl) ->
update_field({context, V}, Tpl) ->
Tpl#domain_InvoiceTemplate{context = V}.

%% Event provider

-spec publish_event(tpl_id(), hg_machine:event_payload()) -> hg_event_provider:public_event().
publish_event(ID, Payload) ->
{{invoice_template_id, ID}, ?ev(unmarshal_event_payload(Payload))}.

%% Marshaling

-include("legacy_structures.hrl").
Expand Down
7 changes: 0 additions & 7 deletions apps/hellgate/test/hg_ct_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,6 @@ start_app(hellgate = AppName) ->
max_connections => 300
}
},
payment_processing_eventsink => #{
url => <<"http://hellgate:8022/v1/processing/eventsink">>,
transport_opts => #{
pool => payment_processing_eventsink,
max_connections => 300
}
},
recurrent_paytool_eventsink => #{
url => <<"http://hellgate:8022/v1/processing/recpaytool/eventsink">>,
transport_opts => #{
Expand Down
29 changes: 0 additions & 29 deletions apps/hellgate/test/hg_eventsink_history.erl

This file was deleted.

Loading

0 comments on commit a30d183

Please sign in to comment.