package hmda.serialization.submission

import hmda.messages.submission.EditDetailsEvents.{
  EditDetailsAdded,
  EditDetailsRowCounted
}
import hmda.persistence.serialization.edit.details.events.{
  EditDetailsAddedMessage,
  EditDetailsRowCountedMessage
}
import EditDetailsProtobufConverter._
import hmda.persistence.serialization.edit.details.EditDetailsMessage

object EditDetailsEventsProtobufConverter {

  def editDetailsAddedToProtobuf(
      evt: EditDetailsAdded): EditDetailsAddedMessage = {
    EditDetailsAddedMessage(
      Some(editDetailsToProtobuf(evt.editDetails))
    )
  }

  def editDetailsAddedFromProtobuf(
      msg: EditDetailsAddedMessage): EditDetailsAdded = {
    EditDetailsAdded(
      editDetailsFromProtobuf(msg.editDetails.getOrElse(EditDetailsMessage()))
    )
  }

  def editDetailsRowCountedToProtobuf(
      evt: EditDetailsRowCounted): EditDetailsRowCountedMessage = {
    EditDetailsRowCountedMessage(
      evt.count
    )
  }

  def editDetailsRowCountedFromProtobuf(
      msg: EditDetailsRowCountedMessage): EditDetailsRowCounted = {
    EditDetailsRowCounted(
      msg.count
    )
  }
}

package hmda.serialization.submission

class EditDetailsEventsProtobufConverter {}

--- 
+++ 
@@ -1,3 +1,43 @@
 package hmda.serialization.submission
 
-class EditDetailsEventsProtobufConverter {}
+import hmda.messages.submission.EditDetailsEvents.{
+  EditDetailsAdded,
+  EditDetailsRowCounted
+}
+import hmda.persistence.serialization.edit.details.events.{
+  EditDetailsAddedMessage,
+  EditDetailsRowCountedMessage
+}
+import EditDetailsProtobufConverter._
+import hmda.persistence.serialization.edit.details.EditDetailsMessage
+
+object EditDetailsEventsProtobufConverter {
+
+  def editDetailsAddedToProtobuf(
+      evt: EditDetailsAdded): EditDetailsAddedMessage = {
+    EditDetailsAddedMessage(
+      Some(editDetailsToProtobuf(evt.editDetails))
+    )
+  }
+
+  def editDetailsAddedFromProtobuf(
+      msg: EditDetailsAddedMessage): EditDetailsAdded = {
+    EditDetailsAdded(
+      editDetailsFromProtobuf(msg.editDetails.getOrElse(EditDetailsMessage()))
+    )
+  }
+
+  def editDetailsRowCountedToProtobuf(
+      evt: EditDetailsRowCounted): EditDetailsRowCountedMessage = {
+    EditDetailsRowCountedMessage(
+      evt.count
+    )
+  }
+
+  def editDetailsRowCountedFromProtobuf(
+      msg: EditDetailsRowCountedMessage): EditDetailsRowCounted = {
+    EditDetailsRowCounted(
+      msg.count
+    )
+  }
+}
Add edit details events protobuf converter
