diff --git a/Jenkinsfile b/Jenkinsfile
index 65b3c46..8051253 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,5 +1,5 @@
#!groovy
-build('thrift-common-lib', 'docker-host') {
+build('sink-common-lib', 'docker-host') {
checkoutRepo()
loadBuildUtils()
diff --git a/README.md b/README.md
index 9ae4395..591b3b8 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# thrift-common-lib
+# sink-common-lib
Библиотека для переиспользования вздаимодействия с протоколами, обрабатываемые machinegun'ном:
- eventsink (hellgate)
- sinkievent (machinegun)
diff --git a/pom.xml b/pom.xml
index 253dbcc..311ba8a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
4.0.0
jar
- thrift-common-lib
+ sink-common-lib
0.0.1
diff --git a/src/main/java/com/rbkmoney/thrift/common/exception/ParseException.java b/src/main/java/com/rbkmoney/sink/common/exception/ParseException.java
similarity index 92%
rename from src/main/java/com/rbkmoney/thrift/common/exception/ParseException.java
rename to src/main/java/com/rbkmoney/sink/common/exception/ParseException.java
index fbe0c10..6c7a081 100644
--- a/src/main/java/com/rbkmoney/thrift/common/exception/ParseException.java
+++ b/src/main/java/com/rbkmoney/sink/common/exception/ParseException.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.exception;
+package com.rbkmoney.sink.common.exception;
public class ParseException extends RuntimeException {
diff --git a/src/main/java/com/rbkmoney/thrift/common/exception/ThriftBinaryDeserializationException.java b/src/main/java/com/rbkmoney/sink/common/exception/ThriftBinaryDeserializationException.java
similarity index 93%
rename from src/main/java/com/rbkmoney/thrift/common/exception/ThriftBinaryDeserializationException.java
rename to src/main/java/com/rbkmoney/sink/common/exception/ThriftBinaryDeserializationException.java
index 5ee43ef..4bd8600 100644
--- a/src/main/java/com/rbkmoney/thrift/common/exception/ThriftBinaryDeserializationException.java
+++ b/src/main/java/com/rbkmoney/sink/common/exception/ThriftBinaryDeserializationException.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.exception;
+package com.rbkmoney.sink.common.exception;
public class ThriftBinaryDeserializationException extends RuntimeException {
diff --git a/src/main/java/com/rbkmoney/thrift/common/exception/ThriftBinarySerializationException.java b/src/main/java/com/rbkmoney/sink/common/exception/ThriftBinarySerializationException.java
similarity index 93%
rename from src/main/java/com/rbkmoney/thrift/common/exception/ThriftBinarySerializationException.java
rename to src/main/java/com/rbkmoney/sink/common/exception/ThriftBinarySerializationException.java
index 4e4a4fc..315e0ab 100644
--- a/src/main/java/com/rbkmoney/thrift/common/exception/ThriftBinarySerializationException.java
+++ b/src/main/java/com/rbkmoney/sink/common/exception/ThriftBinarySerializationException.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.exception;
+package com.rbkmoney.sink.common.exception;
public class ThriftBinarySerializationException extends RuntimeException {
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/EventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/EventHandler.java
new file mode 100644
index 0000000..b62e21d
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/EventHandler.java
@@ -0,0 +1,16 @@
+package com.rbkmoney.sink.common.handle;
+
+public interface EventHandler {
+
+ default boolean accept(E payload) {
+ return true;
+ }
+
+ default void handle(E payload, B baseEvent) {
+
+ }
+
+ default void handle(E payload, B baseEvent, Integer changeId) {
+
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/MachineEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/MachineEventHandler.java
new file mode 100644
index 0000000..6b03604
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/MachineEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.machineevent;
+
+import com.rbkmoney.machinegun.eventsink.MachineEvent;
+import com.rbkmoney.sink.common.handle.EventHandler;
+
+public interface MachineEventHandler extends EventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/PaymentEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/PaymentEventHandler.java
new file mode 100644
index 0000000..1080f7e
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/PaymentEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload;
+
+import com.rbkmoney.damsel.payment_processing.EventPayload;
+import com.rbkmoney.sink.common.handle.machineevent.MachineEventHandler;
+
+public interface PaymentEventHandler extends MachineEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/PayoutEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/PayoutEventHandler.java
new file mode 100644
index 0000000..9dc1092
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/PayoutEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload;
+
+import com.rbkmoney.damsel.payout_processing.EventPayload;
+import com.rbkmoney.sink.common.handle.machineevent.MachineEventHandler;
+
+public interface PayoutEventHandler extends MachineEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/CustomerChangeEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/CustomerChangeEventHandler.java
new file mode 100644
index 0000000..d46b1ca
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/CustomerChangeEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.change;
+
+import com.rbkmoney.damsel.payment_processing.CustomerChange;
+import com.rbkmoney.sink.common.handle.machineevent.MachineEventHandler;
+
+public interface CustomerChangeEventHandler extends MachineEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/InvoiceChangeEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/InvoiceChangeEventHandler.java
new file mode 100644
index 0000000..4cafbd7
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/InvoiceChangeEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.change;
+
+import com.rbkmoney.damsel.payment_processing.InvoiceChange;
+import com.rbkmoney.sink.common.handle.machineevent.MachineEventHandler;
+
+public interface InvoiceChangeEventHandler extends MachineEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/PartyChangeEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/PartyChangeEventHandler.java
new file mode 100644
index 0000000..752a0eb
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/PartyChangeEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.change;
+
+import com.rbkmoney.damsel.payment_processing.PartyChange;
+import com.rbkmoney.sink.common.handle.machineevent.MachineEventHandler;
+
+public interface PartyChangeEventHandler extends MachineEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/PayoutChangeEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/PayoutChangeEventHandler.java
new file mode 100644
index 0000000..19c1e79
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/PayoutChangeEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.change;
+
+import com.rbkmoney.damsel.payout_processing.PayoutChange;
+import com.rbkmoney.sink.common.handle.machineevent.MachineEventHandler;
+
+public interface PayoutChangeEventHandler extends MachineEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/claimeffect/ClaimEffectEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/claimeffect/ClaimEffectEventHandler.java
new file mode 100644
index 0000000..0bbc6ab
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/claimeffect/ClaimEffectEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.change.claimeffect;
+
+import com.rbkmoney.damsel.payment_processing.ClaimEffect;
+import com.rbkmoney.sink.common.handle.machineevent.MachineEventHandler;
+
+public interface ClaimEffectEventHandler extends MachineEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/impl/ClaimEffectStatusAcceptedChangeMachineEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/impl/ClaimEffectStatusAcceptedChangeMachineEventHandler.java
new file mode 100644
index 0000000..b33ffc5
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/change/impl/ClaimEffectStatusAcceptedChangeMachineEventHandler.java
@@ -0,0 +1,35 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.change.impl;
+
+import com.rbkmoney.damsel.payment_processing.ClaimEffect;
+import com.rbkmoney.damsel.payment_processing.PartyChange;
+import com.rbkmoney.machinegun.eventsink.MachineEvent;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.change.PartyChangeEventHandler;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.change.claimeffect.ClaimEffectEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class ClaimEffectStatusAcceptedChangeMachineEventHandler implements PartyChangeEventHandler {
+
+ private final List eventsHandlers;
+
+ @Override
+ public boolean accept(PartyChange payload) {
+ return payload.isSetClaimStatusChanged()
+ && payload.getClaimStatusChanged().getStatus().isSetAccepted()
+ && payload.getClaimStatusChanged().getStatus().getAccepted().isSetEffects();
+ }
+
+ @Override
+ public void handle(PartyChange payload, MachineEvent baseEvent) {
+ for (int i = 0; i < payload.getClaimStatusChanged().getStatus().getAccepted().getEffects().size(); i++) {
+ ClaimEffect effect = payload.getClaimStatusChanged().getStatus().getAccepted().getEffects().get(i);
+ for (ClaimEffectEventHandler eventsHandler : eventsHandlers) {
+ if (eventsHandler.accept(effect)) {
+ eventsHandler.handle(effect, baseEvent, i);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/CustomerChangePaymentMachineEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/CustomerChangePaymentMachineEventHandler.java
new file mode 100644
index 0000000..4124fc6
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/CustomerChangePaymentMachineEventHandler.java
@@ -0,0 +1,34 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.impl;
+
+import com.rbkmoney.damsel.payment_processing.CustomerChange;
+import com.rbkmoney.damsel.payment_processing.EventPayload;
+import com.rbkmoney.machinegun.eventsink.MachineEvent;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.PaymentEventHandler;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.change.CustomerChangeEventHandler;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.List;
+
+@Slf4j
+@RequiredArgsConstructor
+public class CustomerChangePaymentMachineEventHandler implements PaymentEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(EventPayload payload) {
+ return payload.isSetCustomerChanges();
+ }
+
+ @Override
+ public void handle(EventPayload payload, MachineEvent baseEvent) {
+ for (CustomerChange change : payload.getCustomerChanges()) {
+ for (CustomerChangeEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(change)) {
+ eventHandler.handle(change, baseEvent);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/InvoiceChangePaymentMachineEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/InvoiceChangePaymentMachineEventHandler.java
new file mode 100644
index 0000000..a539d6d
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/InvoiceChangePaymentMachineEventHandler.java
@@ -0,0 +1,32 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.impl;
+
+import com.rbkmoney.damsel.payment_processing.EventPayload;
+import com.rbkmoney.damsel.payment_processing.InvoiceChange;
+import com.rbkmoney.machinegun.eventsink.MachineEvent;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.PaymentEventHandler;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.change.InvoiceChangeEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class InvoiceChangePaymentMachineEventHandler implements PaymentEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(EventPayload payload) {
+ return payload.isSetInvoiceChanges();
+ }
+
+ @Override
+ public void handle(EventPayload payload, MachineEvent baseEvent) {
+ for (InvoiceChange change : payload.getInvoiceChanges()) {
+ for (InvoiceChangeEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(change)) {
+ eventHandler.handle(change, baseEvent);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/PartyChangePaymentMachineEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/PartyChangePaymentMachineEventHandler.java
new file mode 100644
index 0000000..a9aee1b
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/PartyChangePaymentMachineEventHandler.java
@@ -0,0 +1,32 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.impl;
+
+import com.rbkmoney.damsel.payment_processing.EventPayload;
+import com.rbkmoney.damsel.payment_processing.PartyChange;
+import com.rbkmoney.machinegun.eventsink.MachineEvent;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.PaymentEventHandler;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.change.PartyChangeEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class PartyChangePaymentMachineEventHandler implements PaymentEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(EventPayload payload) {
+ return payload.isSetPartyChanges();
+ }
+
+ @Override
+ public void handle(EventPayload payload, MachineEvent baseEvent) {
+ for (PartyChange change : payload.getPartyChanges()) {
+ for (PartyChangeEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(change)) {
+ eventHandler.handle(change, baseEvent);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/PayoutChangePayoutMachineEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/PayoutChangePayoutMachineEventHandler.java
new file mode 100644
index 0000000..4506953
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/eventpayload/impl/PayoutChangePayoutMachineEventHandler.java
@@ -0,0 +1,32 @@
+package com.rbkmoney.sink.common.handle.machineevent.eventpayload.impl;
+
+import com.rbkmoney.damsel.payout_processing.EventPayload;
+import com.rbkmoney.damsel.payout_processing.PayoutChange;
+import com.rbkmoney.machinegun.eventsink.MachineEvent;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.PayoutEventHandler;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.change.PayoutChangeEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class PayoutChangePayoutMachineEventHandler implements PayoutEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(EventPayload payload) {
+ return payload.isSetPayoutChanges();
+ }
+
+ @Override
+ public void handle(EventPayload payload, MachineEvent baseEvent) {
+ for (PayoutChange change : payload.getPayoutChanges()) {
+ for (PayoutChangeEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(change)) {
+ eventHandler.handle(change, baseEvent);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/impl/PaymentEventMachineEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/impl/PaymentEventMachineEventHandler.java
new file mode 100644
index 0000000..8aa125a
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/impl/PaymentEventMachineEventHandler.java
@@ -0,0 +1,24 @@
+package com.rbkmoney.sink.common.handle.machineevent.impl;
+
+import com.rbkmoney.damsel.payment_processing.EventPayload;
+import com.rbkmoney.machinegun.eventsink.MachineEvent;
+import com.rbkmoney.sink.common.handle.machineevent.MachineEventHandler;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.PaymentEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class PaymentEventMachineEventHandler implements MachineEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public void handle(EventPayload payload, MachineEvent baseEvent) {
+ for (PaymentEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(payload)) {
+ eventHandler.handle(payload, baseEvent);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/machineevent/impl/PayoutEventMachineEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/impl/PayoutEventMachineEventHandler.java
new file mode 100644
index 0000000..72f273c
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/machineevent/impl/PayoutEventMachineEventHandler.java
@@ -0,0 +1,24 @@
+package com.rbkmoney.sink.common.handle.machineevent.impl;
+
+import com.rbkmoney.damsel.payout_processing.EventPayload;
+import com.rbkmoney.machinegun.eventsink.MachineEvent;
+import com.rbkmoney.sink.common.handle.machineevent.MachineEventHandler;
+import com.rbkmoney.sink.common.handle.machineevent.eventpayload.PayoutEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class PayoutEventMachineEventHandler implements MachineEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public void handle(EventPayload payload, MachineEvent baseEvent) {
+ for (PayoutEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(payload)) {
+ eventHandler.handle(payload, baseEvent);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/StockEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/StockEventHandler.java
new file mode 100644
index 0000000..fd09045
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/StockEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.stockevent;
+
+import com.rbkmoney.damsel.event_stock.StockEvent;
+import com.rbkmoney.sink.common.handle.EventHandler;
+
+public interface StockEventHandler extends EventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/PaymentEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/PaymentEventHandler.java
new file mode 100644
index 0000000..8dec231
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/PaymentEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.stockevent.event;
+
+import com.rbkmoney.damsel.payment_processing.Event;
+import com.rbkmoney.sink.common.handle.stockevent.StockEventHandler;
+
+public interface PaymentEventHandler extends StockEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/PayoutEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/PayoutEventHandler.java
new file mode 100644
index 0000000..484da9a
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/PayoutEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.stockevent.event;
+
+import com.rbkmoney.damsel.payout_processing.Event;
+import com.rbkmoney.sink.common.handle.stockevent.StockEventHandler;
+
+public interface PayoutEventHandler extends StockEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/CustomerChangeEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/CustomerChangeEventHandler.java
new file mode 100644
index 0000000..d1c17a2
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/CustomerChangeEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.change;
+
+import com.rbkmoney.damsel.payment_processing.CustomerChange;
+import com.rbkmoney.sink.common.handle.stockevent.StockEventHandler;
+
+public interface CustomerChangeEventHandler extends StockEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/InvoiceChangeEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/InvoiceChangeEventHandler.java
new file mode 100644
index 0000000..be80f78
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/InvoiceChangeEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.change;
+
+import com.rbkmoney.damsel.payment_processing.InvoiceChange;
+import com.rbkmoney.sink.common.handle.stockevent.StockEventHandler;
+
+public interface InvoiceChangeEventHandler extends StockEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/PartyChangeEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/PartyChangeEventHandler.java
new file mode 100644
index 0000000..a25d165
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/PartyChangeEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.change;
+
+import com.rbkmoney.damsel.payment_processing.PartyChange;
+import com.rbkmoney.sink.common.handle.stockevent.StockEventHandler;
+
+public interface PartyChangeEventHandler extends StockEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/PayoutChangeEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/PayoutChangeEventHandler.java
new file mode 100644
index 0000000..2eeb0b3
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/PayoutChangeEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.change;
+
+import com.rbkmoney.damsel.payout_processing.PayoutChange;
+import com.rbkmoney.sink.common.handle.stockevent.StockEventHandler;
+
+public interface PayoutChangeEventHandler extends StockEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/claimeffect/ClaimEffectEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/claimeffect/ClaimEffectEventHandler.java
new file mode 100644
index 0000000..5a2d3b5
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/claimeffect/ClaimEffectEventHandler.java
@@ -0,0 +1,8 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.change.claimeffect;
+
+import com.rbkmoney.damsel.payment_processing.ClaimEffect;
+import com.rbkmoney.sink.common.handle.stockevent.StockEventHandler;
+
+public interface ClaimEffectEventHandler extends StockEventHandler {
+
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/impl/ClaimEffectStatusAcceptedChangeStockEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/impl/ClaimEffectStatusAcceptedChangeStockEventHandler.java
new file mode 100644
index 0000000..37f2c6e
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/change/impl/ClaimEffectStatusAcceptedChangeStockEventHandler.java
@@ -0,0 +1,35 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.change.impl;
+
+import com.rbkmoney.damsel.event_stock.StockEvent;
+import com.rbkmoney.damsel.payment_processing.ClaimEffect;
+import com.rbkmoney.damsel.payment_processing.PartyChange;
+import com.rbkmoney.sink.common.handle.stockevent.event.change.PartyChangeEventHandler;
+import com.rbkmoney.sink.common.handle.stockevent.event.change.claimeffect.ClaimEffectEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class ClaimEffectStatusAcceptedChangeStockEventHandler implements PartyChangeEventHandler {
+
+ private final List eventsHandlers;
+
+ @Override
+ public boolean accept(PartyChange payload) {
+ return payload.isSetClaimStatusChanged()
+ && payload.getClaimStatusChanged().getStatus().isSetAccepted()
+ && payload.getClaimStatusChanged().getStatus().getAccepted().isSetEffects();
+ }
+
+ @Override
+ public void handle(PartyChange payload, StockEvent baseEvent) {
+ for (int i = 0; i < payload.getClaimStatusChanged().getStatus().getAccepted().getEffects().size(); i++) {
+ ClaimEffect effect = payload.getClaimStatusChanged().getStatus().getAccepted().getEffects().get(i);
+ for (ClaimEffectEventHandler eventsHandler : eventsHandlers) {
+ if (eventsHandler.accept(effect)) {
+ eventsHandler.handle(effect, baseEvent, i);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/CustomerChangePaymentStockEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/CustomerChangePaymentStockEventHandler.java
new file mode 100644
index 0000000..5909878
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/CustomerChangePaymentStockEventHandler.java
@@ -0,0 +1,32 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.impl;
+
+import com.rbkmoney.damsel.event_stock.StockEvent;
+import com.rbkmoney.damsel.payment_processing.CustomerChange;
+import com.rbkmoney.damsel.payment_processing.Event;
+import com.rbkmoney.sink.common.handle.stockevent.event.PaymentEventHandler;
+import com.rbkmoney.sink.common.handle.stockevent.event.change.CustomerChangeEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class CustomerChangePaymentStockEventHandler implements PaymentEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(Event payload) {
+ return payload.getPayload().isSetCustomerChanges();
+ }
+
+ @Override
+ public void handle(Event payload, StockEvent baseEvent) {
+ for (CustomerChange change : payload.getPayload().getCustomerChanges()) {
+ for (CustomerChangeEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(change)) {
+ eventHandler.handle(change, baseEvent);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/InvoiceChangePaymentStockEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/InvoiceChangePaymentStockEventHandler.java
new file mode 100644
index 0000000..aa8b15f
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/InvoiceChangePaymentStockEventHandler.java
@@ -0,0 +1,32 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.impl;
+
+import com.rbkmoney.damsel.event_stock.StockEvent;
+import com.rbkmoney.damsel.payment_processing.Event;
+import com.rbkmoney.damsel.payment_processing.InvoiceChange;
+import com.rbkmoney.sink.common.handle.stockevent.event.PaymentEventHandler;
+import com.rbkmoney.sink.common.handle.stockevent.event.change.InvoiceChangeEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class InvoiceChangePaymentStockEventHandler implements PaymentEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(Event payload) {
+ return payload.getPayload().isSetInvoiceChanges();
+ }
+
+ @Override
+ public void handle(Event payload, StockEvent baseEvent) {
+ for (InvoiceChange change : payload.getPayload().getInvoiceChanges()) {
+ for (InvoiceChangeEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(change)) {
+ eventHandler.handle(change, baseEvent);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/PartyChangePaymentStockEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/PartyChangePaymentStockEventHandler.java
new file mode 100644
index 0000000..e0e0879
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/PartyChangePaymentStockEventHandler.java
@@ -0,0 +1,32 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.impl;
+
+import com.rbkmoney.damsel.event_stock.StockEvent;
+import com.rbkmoney.damsel.payment_processing.Event;
+import com.rbkmoney.damsel.payment_processing.PartyChange;
+import com.rbkmoney.sink.common.handle.stockevent.event.PaymentEventHandler;
+import com.rbkmoney.sink.common.handle.stockevent.event.change.PartyChangeEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class PartyChangePaymentStockEventHandler implements PaymentEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(Event payload) {
+ return payload.getPayload().isSetPartyChanges();
+ }
+
+ @Override
+ public void handle(Event payload, StockEvent baseEvent) {
+ for (PartyChange change : payload.getPayload().getPartyChanges()) {
+ for (PartyChangeEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(change)) {
+ eventHandler.handle(change, baseEvent);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/PayoutChangePayoutStockEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/PayoutChangePayoutStockEventHandler.java
new file mode 100644
index 0000000..c6b0583
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/event/impl/PayoutChangePayoutStockEventHandler.java
@@ -0,0 +1,32 @@
+package com.rbkmoney.sink.common.handle.stockevent.event.impl;
+
+import com.rbkmoney.damsel.event_stock.StockEvent;
+import com.rbkmoney.damsel.payout_processing.Event;
+import com.rbkmoney.damsel.payout_processing.PayoutChange;
+import com.rbkmoney.sink.common.handle.stockevent.event.PayoutEventHandler;
+import com.rbkmoney.sink.common.handle.stockevent.event.change.PayoutChangeEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class PayoutChangePayoutStockEventHandler implements PayoutEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(Event payload) {
+ return payload.getPayload().isSetPayoutChanges();
+ }
+
+ @Override
+ public void handle(Event payload, StockEvent baseEvent) {
+ for (PayoutChange change : payload.getPayload().getPayoutChanges()) {
+ for (PayoutChangeEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(change)) {
+ eventHandler.handle(change, baseEvent);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/impl/PaymentEventStockEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/impl/PaymentEventStockEventHandler.java
new file mode 100644
index 0000000..cbe2f53
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/impl/PaymentEventStockEventHandler.java
@@ -0,0 +1,30 @@
+package com.rbkmoney.sink.common.handle.stockevent.impl;
+
+import com.rbkmoney.damsel.event_stock.StockEvent;
+import com.rbkmoney.damsel.payment_processing.Event;
+import com.rbkmoney.sink.common.handle.stockevent.StockEventHandler;
+import com.rbkmoney.sink.common.handle.stockevent.event.PaymentEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class PaymentEventStockEventHandler implements StockEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(StockEvent payload) {
+ return payload.getSourceEvent().isSetProcessingEvent();
+ }
+
+ @Override
+ public void handle(StockEvent payload, StockEvent baseEvent) {
+ Event event = payload.getSourceEvent().getProcessingEvent();
+ for (PaymentEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(event)) {
+ eventHandler.handle(event, baseEvent);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/sink/common/handle/stockevent/impl/PayoutEventStockEventHandler.java b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/impl/PayoutEventStockEventHandler.java
new file mode 100644
index 0000000..995ccaf
--- /dev/null
+++ b/src/main/java/com/rbkmoney/sink/common/handle/stockevent/impl/PayoutEventStockEventHandler.java
@@ -0,0 +1,30 @@
+package com.rbkmoney.sink.common.handle.stockevent.impl;
+
+import com.rbkmoney.damsel.event_stock.StockEvent;
+import com.rbkmoney.damsel.payout_processing.Event;
+import com.rbkmoney.sink.common.handle.stockevent.StockEventHandler;
+import com.rbkmoney.sink.common.handle.stockevent.event.PayoutEventHandler;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+@RequiredArgsConstructor
+public class PayoutEventStockEventHandler implements StockEventHandler {
+
+ private final List eventHandlers;
+
+ @Override
+ public boolean accept(StockEvent payload) {
+ return payload.getSourceEvent().isSetPayoutEvent();
+ }
+
+ @Override
+ public void handle(StockEvent payload, StockEvent baseEvent) {
+ Event event = payload.getSourceEvent().getPayoutEvent();
+ for (PayoutEventHandler eventHandler : eventHandlers) {
+ if (eventHandler.accept(event)) {
+ eventHandler.handle(event, baseEvent);
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/rbkmoney/thrift/common/parser/Parser.java b/src/main/java/com/rbkmoney/sink/common/parser/Parser.java
similarity index 57%
rename from src/main/java/com/rbkmoney/thrift/common/parser/Parser.java
rename to src/main/java/com/rbkmoney/sink/common/parser/Parser.java
index a0f15a8..50fa4ee 100644
--- a/src/main/java/com/rbkmoney/thrift/common/parser/Parser.java
+++ b/src/main/java/com/rbkmoney/sink/common/parser/Parser.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.parser;
+package com.rbkmoney.sink.common.parser;
public interface Parser {
diff --git a/src/main/java/com/rbkmoney/thrift/common/parser/impl/MachineEventParser.java b/src/main/java/com/rbkmoney/sink/common/parser/impl/MachineEventParser.java
similarity index 73%
rename from src/main/java/com/rbkmoney/thrift/common/parser/impl/MachineEventParser.java
rename to src/main/java/com/rbkmoney/sink/common/parser/impl/MachineEventParser.java
index f11b7a7..844c6d6 100644
--- a/src/main/java/com/rbkmoney/thrift/common/parser/impl/MachineEventParser.java
+++ b/src/main/java/com/rbkmoney/sink/common/parser/impl/MachineEventParser.java
@@ -1,9 +1,9 @@
-package com.rbkmoney.thrift.common.parser.impl;
+package com.rbkmoney.sink.common.parser.impl;
import com.rbkmoney.machinegun.eventsink.MachineEvent;
-import com.rbkmoney.thrift.common.exception.ParseException;
-import com.rbkmoney.thrift.common.parser.Parser;
-import com.rbkmoney.thrift.common.serialization.BinaryDeserializer;
+import com.rbkmoney.sink.common.exception.ParseException;
+import com.rbkmoney.sink.common.parser.Parser;
+import com.rbkmoney.sink.common.serialization.BinaryDeserializer;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
diff --git a/src/main/java/com/rbkmoney/thrift/common/parser/impl/PaymentEventPayloadMachineEventParser.java b/src/main/java/com/rbkmoney/sink/common/parser/impl/PaymentEventPayloadMachineEventParser.java
similarity index 71%
rename from src/main/java/com/rbkmoney/thrift/common/parser/impl/PaymentEventPayloadMachineEventParser.java
rename to src/main/java/com/rbkmoney/sink/common/parser/impl/PaymentEventPayloadMachineEventParser.java
index 895708d..ea0d4d5 100644
--- a/src/main/java/com/rbkmoney/thrift/common/parser/impl/PaymentEventPayloadMachineEventParser.java
+++ b/src/main/java/com/rbkmoney/sink/common/parser/impl/PaymentEventPayloadMachineEventParser.java
@@ -1,7 +1,7 @@
-package com.rbkmoney.thrift.common.parser.impl;
+package com.rbkmoney.sink.common.parser.impl;
import com.rbkmoney.damsel.payment_processing.EventPayload;
-import com.rbkmoney.thrift.common.serialization.BinaryDeserializer;
+import com.rbkmoney.sink.common.serialization.BinaryDeserializer;
public class PaymentEventPayloadMachineEventParser extends MachineEventParser {
diff --git a/src/main/java/com/rbkmoney/thrift/common/parser/impl/PayoutEventPayloadMachineEventParser.java b/src/main/java/com/rbkmoney/sink/common/parser/impl/PayoutEventPayloadMachineEventParser.java
similarity index 71%
rename from src/main/java/com/rbkmoney/thrift/common/parser/impl/PayoutEventPayloadMachineEventParser.java
rename to src/main/java/com/rbkmoney/sink/common/parser/impl/PayoutEventPayloadMachineEventParser.java
index 77a3245..2e95824 100644
--- a/src/main/java/com/rbkmoney/thrift/common/parser/impl/PayoutEventPayloadMachineEventParser.java
+++ b/src/main/java/com/rbkmoney/sink/common/parser/impl/PayoutEventPayloadMachineEventParser.java
@@ -1,7 +1,7 @@
-package com.rbkmoney.thrift.common.parser.impl;
+package com.rbkmoney.sink.common.parser.impl;
import com.rbkmoney.damsel.payout_processing.EventPayload;
-import com.rbkmoney.thrift.common.serialization.BinaryDeserializer;
+import com.rbkmoney.sink.common.serialization.BinaryDeserializer;
public class PayoutEventPayloadMachineEventParser extends MachineEventParser {
diff --git a/src/main/java/com/rbkmoney/thrift/common/serialization/BinaryDeserializer.java b/src/main/java/com/rbkmoney/sink/common/serialization/BinaryDeserializer.java
similarity index 60%
rename from src/main/java/com/rbkmoney/thrift/common/serialization/BinaryDeserializer.java
rename to src/main/java/com/rbkmoney/sink/common/serialization/BinaryDeserializer.java
index ea1bae1..eba81b5 100644
--- a/src/main/java/com/rbkmoney/thrift/common/serialization/BinaryDeserializer.java
+++ b/src/main/java/com/rbkmoney/sink/common/serialization/BinaryDeserializer.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.serialization;
+package com.rbkmoney.sink.common.serialization;
public interface BinaryDeserializer {
diff --git a/src/main/java/com/rbkmoney/thrift/common/serialization/BinarySerializer.java b/src/main/java/com/rbkmoney/sink/common/serialization/BinarySerializer.java
similarity index 59%
rename from src/main/java/com/rbkmoney/thrift/common/serialization/BinarySerializer.java
rename to src/main/java/com/rbkmoney/sink/common/serialization/BinarySerializer.java
index 23c4871..b130eb8 100644
--- a/src/main/java/com/rbkmoney/thrift/common/serialization/BinarySerializer.java
+++ b/src/main/java/com/rbkmoney/sink/common/serialization/BinarySerializer.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.serialization;
+package com.rbkmoney.sink.common.serialization;
public interface BinarySerializer {
diff --git a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/AbstractThriftBinaryDeserializer.java b/src/main/java/com/rbkmoney/sink/common/serialization/impl/AbstractThriftBinaryDeserializer.java
similarity index 78%
rename from src/main/java/com/rbkmoney/thrift/common/serialization/impl/AbstractThriftBinaryDeserializer.java
rename to src/main/java/com/rbkmoney/sink/common/serialization/impl/AbstractThriftBinaryDeserializer.java
index 44ee5cd..8b4cddb 100644
--- a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/AbstractThriftBinaryDeserializer.java
+++ b/src/main/java/com/rbkmoney/sink/common/serialization/impl/AbstractThriftBinaryDeserializer.java
@@ -1,7 +1,7 @@
-package com.rbkmoney.thrift.common.serialization.impl;
+package com.rbkmoney.sink.common.serialization.impl;
-import com.rbkmoney.thrift.common.exception.ThriftBinaryDeserializationException;
-import com.rbkmoney.thrift.common.serialization.BinaryDeserializer;
+import com.rbkmoney.sink.common.exception.ThriftBinaryDeserializationException;
+import com.rbkmoney.sink.common.serialization.BinaryDeserializer;
import lombok.extern.slf4j.Slf4j;
import org.apache.thrift.TBase;
import org.apache.thrift.TDeserializer;
diff --git a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/PaymentEventPayloadDeserializer.java b/src/main/java/com/rbkmoney/sink/common/serialization/impl/PaymentEventPayloadDeserializer.java
similarity index 84%
rename from src/main/java/com/rbkmoney/thrift/common/serialization/impl/PaymentEventPayloadDeserializer.java
rename to src/main/java/com/rbkmoney/sink/common/serialization/impl/PaymentEventPayloadDeserializer.java
index 783d284..fa929e7 100644
--- a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/PaymentEventPayloadDeserializer.java
+++ b/src/main/java/com/rbkmoney/sink/common/serialization/impl/PaymentEventPayloadDeserializer.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.serialization.impl;
+package com.rbkmoney.sink.common.serialization.impl;
import com.rbkmoney.damsel.payment_processing.EventPayload;
diff --git a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/PaymentEventPayloadSerializer.java b/src/main/java/com/rbkmoney/sink/common/serialization/impl/PaymentEventPayloadSerializer.java
similarity index 73%
rename from src/main/java/com/rbkmoney/thrift/common/serialization/impl/PaymentEventPayloadSerializer.java
rename to src/main/java/com/rbkmoney/sink/common/serialization/impl/PaymentEventPayloadSerializer.java
index 60b8886..bf305a7 100644
--- a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/PaymentEventPayloadSerializer.java
+++ b/src/main/java/com/rbkmoney/sink/common/serialization/impl/PaymentEventPayloadSerializer.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.serialization.impl;
+package com.rbkmoney.sink.common.serialization.impl;
import com.rbkmoney.damsel.payment_processing.EventPayload;
diff --git a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/PayoutEventPayloadDeserializer.java b/src/main/java/com/rbkmoney/sink/common/serialization/impl/PayoutEventPayloadDeserializer.java
similarity index 83%
rename from src/main/java/com/rbkmoney/thrift/common/serialization/impl/PayoutEventPayloadDeserializer.java
rename to src/main/java/com/rbkmoney/sink/common/serialization/impl/PayoutEventPayloadDeserializer.java
index dc00cce..d503394 100644
--- a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/PayoutEventPayloadDeserializer.java
+++ b/src/main/java/com/rbkmoney/sink/common/serialization/impl/PayoutEventPayloadDeserializer.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.serialization.impl;
+package com.rbkmoney.sink.common.serialization.impl;
import com.rbkmoney.damsel.payout_processing.EventPayload;
diff --git a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/PayoutEventPayloadSerializer.java b/src/main/java/com/rbkmoney/sink/common/serialization/impl/PayoutEventPayloadSerializer.java
similarity index 73%
rename from src/main/java/com/rbkmoney/thrift/common/serialization/impl/PayoutEventPayloadSerializer.java
rename to src/main/java/com/rbkmoney/sink/common/serialization/impl/PayoutEventPayloadSerializer.java
index ebb9dbb..5f217fb 100644
--- a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/PayoutEventPayloadSerializer.java
+++ b/src/main/java/com/rbkmoney/sink/common/serialization/impl/PayoutEventPayloadSerializer.java
@@ -1,4 +1,4 @@
-package com.rbkmoney.thrift.common.serialization.impl;
+package com.rbkmoney.sink.common.serialization.impl;
import com.rbkmoney.damsel.payment_processing.EventPayload;
diff --git a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/ThriftBinarySerializer.java b/src/main/java/com/rbkmoney/sink/common/serialization/impl/ThriftBinarySerializer.java
similarity index 77%
rename from src/main/java/com/rbkmoney/thrift/common/serialization/impl/ThriftBinarySerializer.java
rename to src/main/java/com/rbkmoney/sink/common/serialization/impl/ThriftBinarySerializer.java
index 6f8a1e9..0a0dae3 100644
--- a/src/main/java/com/rbkmoney/thrift/common/serialization/impl/ThriftBinarySerializer.java
+++ b/src/main/java/com/rbkmoney/sink/common/serialization/impl/ThriftBinarySerializer.java
@@ -1,7 +1,7 @@
-package com.rbkmoney.thrift.common.serialization.impl;
+package com.rbkmoney.sink.common.serialization.impl;
-import com.rbkmoney.thrift.common.exception.ThriftBinarySerializationException;
-import com.rbkmoney.thrift.common.serialization.BinarySerializer;
+import com.rbkmoney.sink.common.exception.ThriftBinarySerializationException;
+import com.rbkmoney.sink.common.serialization.BinarySerializer;
import lombok.extern.slf4j.Slf4j;
import org.apache.thrift.TBase;
import org.apache.thrift.TException;
diff --git a/src/test/java/com/rbkmoney/thrift/common/parser/ParserTest.java b/src/test/java/com/rbkmoney/sink/common/parser/ParserTest.java
similarity index 78%
rename from src/test/java/com/rbkmoney/thrift/common/parser/ParserTest.java
rename to src/test/java/com/rbkmoney/sink/common/parser/ParserTest.java
index 0db58ed..9b19521 100644
--- a/src/test/java/com/rbkmoney/thrift/common/parser/ParserTest.java
+++ b/src/test/java/com/rbkmoney/sink/common/parser/ParserTest.java
@@ -1,11 +1,11 @@
-package com.rbkmoney.thrift.common.parser;
+package com.rbkmoney.sink.common.parser;
import com.rbkmoney.damsel.payment_processing.EventPayload;
import com.rbkmoney.machinegun.eventsink.MachineEvent;
import com.rbkmoney.machinegun.msgpack.Value;
-import com.rbkmoney.thrift.common.parser.impl.PaymentEventPayloadMachineEventParser;
-import com.rbkmoney.thrift.common.serialization.impl.PaymentEventPayloadDeserializer;
-import com.rbkmoney.thrift.common.serialization.impl.PaymentEventPayloadSerializer;
+import com.rbkmoney.sink.common.parser.impl.PaymentEventPayloadMachineEventParser;
+import com.rbkmoney.sink.common.serialization.impl.PaymentEventPayloadDeserializer;
+import com.rbkmoney.sink.common.serialization.impl.PaymentEventPayloadSerializer;
import org.junit.Test;
import java.util.Collections;
diff --git a/src/test/java/com/rbkmoney/thrift/common/serialization/SerializationTest.java b/src/test/java/com/rbkmoney/sink/common/serialization/SerializationTest.java
similarity index 77%
rename from src/test/java/com/rbkmoney/thrift/common/serialization/SerializationTest.java
rename to src/test/java/com/rbkmoney/sink/common/serialization/SerializationTest.java
index 6d87616..13c1a17 100644
--- a/src/test/java/com/rbkmoney/thrift/common/serialization/SerializationTest.java
+++ b/src/test/java/com/rbkmoney/sink/common/serialization/SerializationTest.java
@@ -1,8 +1,8 @@
-package com.rbkmoney.thrift.common.serialization;
+package com.rbkmoney.sink.common.serialization;
import com.rbkmoney.damsel.payment_processing.EventPayload;
-import com.rbkmoney.thrift.common.serialization.impl.PaymentEventPayloadDeserializer;
-import com.rbkmoney.thrift.common.serialization.impl.PaymentEventPayloadSerializer;
+import com.rbkmoney.sink.common.serialization.impl.PaymentEventPayloadDeserializer;
+import com.rbkmoney.sink.common.serialization.impl.PaymentEventPayloadSerializer;
import org.junit.Test;
import java.util.Collections;