delta
delta copied to clipboard
Support labelled HList instance
By moving the current instances into a hlist.unlabelled object and creating a hlist.labelled object.
See https://github.com/milessabin/shapeless/blob/master/examples/src/main/scala/shapeless/examples/sexp.scala for an example a hlist instance that uses labels.
Not sure if this is what you mean but we'd want to know the field name which is different and probably the nested classes.
case class Customer(address: Address)
case class Address(line1: String, zip: Zip)
case class Zip(zip: Int, plusFour: Option[Int])
So if zipPlusFour was changed we'd want a label like Customer.Address.Zip.plusFour
along with the change type:
sealed trait ChangeType
final case class Added[T](newValue: T) extends ChangeType // eg 1234
final case class Updated[T](originalValue: T, updatedValue: T) extends ChangeType //eg 1234, 2345
final case class Removed[T](deletedValue: T) extends ChangeType // eg 2345