We have two services that send messages with a lot of data:
case class TargetId(value: Int)
case class Action(amount: Int, message: String)
case class Message(
messageId: Long,
targetId: TargetId,
action: Action,
)
Both services are redirected to a third service, but there is a problem. Message sources can sometimes produce identical messages. But we don't want to send duplicates.
Write the areTheSameMessages function that will return true if the messages are the same across all fields.